Get the command-line representation of the options for a supervisor.

@param  \Laravel\Horizon\SupervisorOptions  $options
@return string
557106
public static function fromOptions(SupervisorOptions $options)
    {
        $command = str_replace('@php', PhpBinary::path(), static::$command);

        return sprintf(
            "%s {$options->name} {$options->connection} %s",
            $command,
            static::toOptionsString($options)
        );
    }
1041641
private function getValidatorOptions(array $options)
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'groups' => null,
            'traverse' => false,
            'deep' => false,
        ]);

        return $resolver->resolve(isset($options['validator']) ? $options['validator'] : []);
    }
90954
private function mergeEnvironmentVariablesIntoOptions($options)
    {
        // map environment variables to script options
        foreach (self::$optionsMap as $env => $option) {
            if (false !== ($value = getenv($env))) {
                $options[$option] = (string)$value;
            }
        }
        return $options;
    }
1314619
private function constructOptionsString()
    {
        $options = implode(' ', $this->commandLineOptions);

        foreach ($this->properties as $name => $value) {
            $arg = sprintf('%s=%s', $name, $value);
            $options .= ' -D ' . escapeshellarg($arg);
        }

        return $options;
    }
1071404
public function options(array $options = null)
    {
        if (null === $options) {
            return $this->options;
        }

        $this->options = [];
        foreach($options as $option)
            $this->options[$option] = false;

        return $this;
    }
1044764
public function listFiles($options = [])
    {
        $builder = $this->processHelper->getProcessBuilder(
            [
                'git',
                '--no-pager',
                'ls-files',
            ]
        );

        foreach ($options as $name => $value) {
            $builder->setOption($name, $value);
        }

        $process = $builder->getProcess();
        $process->run();

        return StringUtil::splitLines($process->getOutput());
    }
1250978
private function getOptionText() : string
    {
        if (count($this->command->getOptions()) === 0) {
            return '  No options';
        }

        $optionTexts = [];

        foreach ($this->command->getOptions() as $option) {
            $optionTexts[] = [$this->getOptionNames($option), $option->getDescription()];
        }

        return $this->paddingFormatter->format($optionTexts, function ($row) {
            return "  <info>{$row[0]}</info> - {$row[1]}";
        });
    }
893833
private function getOptions($options)
    {
        $conf = [
            CURLOPT_HEADER => false,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_FOLLOWLOCATION => true
        ];

        if (isset($options['timeout'])) {
            $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
        }
        if (isset($options['connect_timeout'])) {
            $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
        }

        return $conf;
    }
129399
public function getOptions($options)
    {
        // Add verify to options
        $options = array_merge(['verify' => $this->verify], $options);

        if ($this->async) {
            $options = array_merge(['future' => true], $options);
        }

        // merge and return
        return array_merge_recursive($this->options, $options);
    }
1250160
public function getSshCommand(array $extraOptions = [])
    {
        $command = 'ssh';
        $args = $this->getSshArgs($extraOptions);
        if (!empty($args)) {
            $command .= ' ' . implode(' ', array_map('escapeshellarg', $args));
        }

        return $command;
    }
846513
protected function getUrl(array $options): string
    {
        $urlOptions = [];
        $this->setOriginAndDestinationOption($urlOptions, $options);
        $this->setViaOption($urlOptions, $options);
        $this->setDateOption($urlOptions, $options);

        $urlOptions = array_merge($urlOptions, $options);

        return sprintf('trip?%s&format=json', http_build_query($urlOptions));
    }
373846
protected function getOptions()
    {
        // General options
        $global = [
            ['parallel', 'P', InputOption::VALUE_NONE, 'Run the tasks asynchronously instead of sequentially'],
            [
                'pretend',
                'p',
                InputOption::VALUE_NONE,
                'Shows which command would execute without actually doing anything',
            ],
        ];

        // Options that override the predefined configuration
        $overrides = [
            ['on', 'C', InputOption::VALUE_REQUIRED, 'The connection(s) to execute the Task in'],
            ['stage', 'S', InputOption::VALUE_REQUIRED, 'The stage to execute the Task in'],
            ['server', null, InputOption::VALUE_REQUIRED, 'The server to execute the Task in'],
            ['branch', 'B', InputOption::VALUE_REQUIRED, 'The branch to deploy'],
            ['release', null, InputOption::VALUE_REQUIRED, 'What to tag the release as'],
        ];

        // Additional credentials passed to Rocketeer
        $credentials = [
            ['host', null, InputOption::VALUE_REQUIRED, 'The host to use if asked'],
            ['root_directory', null, InputOption::VALUE_REQUIRED, 'The root directory to use if asked'],
            ['username', null, InputOption::VALUE_REQUIRED, 'The username to use if asked'],
            ['password', null, InputOption::VALUE_REQUIRED, 'The password to use if asked'],
            ['key', null, InputOption::VALUE_REQUIRED, 'The key to use if asked'],
            ['keyphrase', null, InputOption::VALUE_REQUIRED, 'The keyphrase to use if asked'],
            ['repository', null, InputOption::VALUE_REQUIRED, 'The repository to use if asked'],
        ];

        return array_merge(
            $global,
            $overrides,
            $credentials
        );
    }
936965
protected function getCellOptions($options)
    {
        $cellOptions = $options['cell-options'];

        $inheritableOptions = $this->getInheritableOptions();

        foreach ($inheritableOptions as $inheritableOption) {
            $cellOptions[$inheritableOption] =
                isset($cellOptions[$inheritableOption])
                ? $cellOptions[$inheritableOption]
                : $options[$inheritableOption];
        }

        if (isset($cellOptions['translate_content']) && $cellOptions['translate_content']) {
            $cellOptions['translator'] = $this->translator;
        }

        return $cellOptions;
    }
385857
private function _optionsToString(array $options)
    {
        $str = '';
        foreach ($options as $key => $val) {
            if ($key === 'password')
                $val = '*****';
            if ($str)
                $str .= ',';
            $str .= $key . '=' . $val;
        }
        return $str;
    }
612143
protected function getOptions(array  $options): array
    {
        $options['format'] = array_get($options, 'format', $this->format);
        $options['locale'] = array_get($options, 'locale', config('app.locale'));

        return $options;
    }
883930
protected function renderOptionTags($options)
    {
        $output = '';
        if ($this->hasArgument('prependOptionLabel')) {
            $value = $this->hasArgument('prependOptionValue') ? $this->arguments['prependOptionValue'] : '';
            if ($this->hasArgument('translate')) {
                $label = $this->getTranslatedLabel($value, $this->arguments['prependOptionLabel']);
            } else {
                $label = $this->arguments['prependOptionLabel'];
            }

            $output .= $this->renderOptionTag($value, $label) . chr(10);
        } elseif (empty($options)) {
            $options = array('' => '');
        }
        foreach ($options as $value => $label) {
            $output .= $this->renderOptionTag($value, $label) . chr(10);
        }
        return $output;
    }
1249516
public function getOption($option)
    {
        if (null !== $this->logger) {
            $this->logger->startMethod('getOption', ['option' => $option]);
        }

        if (!$this->assertOption($option)) {
            $this->stopMethod();

            return false;
        }

        $this->setResultOK();
        $this->stopMethod();

        return array_key_exists($option, $this->options) ? $this->options[$option] : false;
    }