private function replaceTokens($option)
    {
        if (is_array($option)) {
            $tokenizedOptions = [];
            foreach ($option as $key => $opt) {
                $tokenizedOptions[$key] = $this->replaceTokens($opt);
            }

            return $tokenizedOptions;
        }

        return preg_replace_callback(
            '/\$(.+)\$|\$\{(.+)\}/',
            function ($match) {
                $val = isset($match[2]) ? getenv($match[2]) : getenv($match[1]);

                return $val !== false ? $val : $match[0];
            },
            $option
        );
    }