Convert the provisioning plan into an array of SupervisorOptions.

@return array
776407
public function toSupervisorOptions()
    {
        return collect($this->plan)->mapWithKeys(function ($plan, $environment) {
            return [$environment => collect($plan)->mapWithKeys(function ($options, $supervisor) {
                return [$supervisor => $this->convert($supervisor, $options)];
            })];
        })->all();
    }
87283
public function monitoring()
    {
        return collect(app(SupervisorRepository::class)->all())
            ->pluck('pid')
            ->pipe(function ($processes) {
                $processes->each(function ($process) use (&$processes) {
                    $processes = $processes->merge($this->exec->run("pgrep -P {$process}"));
                });

                return $processes;
            })
            ->merge(
                Arr::pluck(app(MasterSupervisorRepository::class)->all(), 'pid')
            )->all();
    }
134643
public function toOptionArray()
    {
        $statuses = $this->orderConfig->getStatuses();

        $options[] = [
            'label' => __('---- Default Option ----'),
            'value' => '0',
        ];

        foreach ($statuses as $code => $label) {
            $options[] = ['value' => $code, 'label' => $label];
        }

        return $options;
    }
331832
public function getItems()
    {
        $manager = Configs::authManager();
        $available = [];
        foreach (array_keys($manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        $assigned = [];
        foreach ($manager->getAssignments($this->id) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }
801378
public static function getControlCapabilities()
    {
        $caps = array();
        foreach (array_keys(self::$virtualCapabilities) as $capabilityName) {
            $caps[] = self::PREFIX_CONTROL . $capabilityName;
        }

        return $caps;
    }
775974
public static function getRemoteEnvironments()
    {
        $environments = [];

        foreach (self::getProjectConfig()->getRemote() as $remote) {
            foreach ($remote as $environment) {
                if (!isset($environment['realm'])) {
                    continue;
                }
                $realm = $environment['realm'];
                unset($environment['realm']);

                $environments[$realm][] = $environment;
            }
        }

        return $environments;
    }
870431
public function getOptions()
    {
        return [
            \Dotdigitalgroup\Email\Model\Importer::NOT_IMPORTED => __('Not Imported'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTING => __('Importing'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTED => __('Imported'),
            \Dotdigitalgroup\Email\Model\Importer::FAILED => __('Failed'),
        ];
    }
754256
public function getOptions()
    {
        $ret = array();
        if (!empty($this->taskDef['opts'])) {
            foreach ($this->taskDef['opts'] as $opt) {
                $ret[] = $opt->name;
            }
        }
        return $ret;
    }
537554
public function toCurlOptions()
    {
        $options = array();
        $options[CURLOPT_SSL_VERIFYPEER] = $this->verifyPeer;
        $options[CURLOPT_SSL_VERIFYHOST] = $this->verifyPeer ? 2 : 0;
        if ($this->caFile) {
            $options[CURLOPT_CAINFO] = $this->caFile;
        } // else: system default
        return $options;
    }
137825
protected function getOptions()
    {
        foreach ($options = parent::getOptions() as $i => $option) {
            if ($option[0] === 'class') {
                $option[4] = config('tenancy.db.tenant-seed-class', false) ?: $option[4];

                $options[$i] = $option;
            }
        }

        return array_merge($options, [
            $this->addWebsiteOption()
        ]);
    }
27077
protected function getDaemonOptions()
    {
        return [
            ['daemon', null, InputOption::VALUE_NONE,     'Run the command in daemon mode'],
            ['sleep',  null, InputOption::VALUE_OPTIONAL, 'Number of seconds to sleep when no job is available', 3],
            ['memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128],
        ];
    }
1159308
public static function optionsAccessLevels(): array
    {
        return [
            Auth::PRIV_PRIVATE => I18N::translate('Show to visitors'),
            Auth::PRIV_USER    => I18N::translate('Show to members'),
            Auth::PRIV_NONE    => I18N::translate('Show to managers'),
            Auth::PRIV_HIDE    => I18N::translate('Hide from everyone'),
        ];
    }
1072303
private function getDependencies(): array
    {
        return [
            'invokables' => [
                NullLogger::class => NullLogger::class,
            ],
            'factories' => [
                Job\JobManager::class => Job\JobManagerFactory::class,
                Job\Strategy\ContainerStrategy::class => Job\Strategy\ContainerStrategyFactory::class,
                Queue\QueueManager::class => Queue\QueueManagerFactory::class,
                Queue\Strategy\Simple::class => Queue\Strategy\SimpleFactory::class,
                Worker\Worker::class => Worker\WorkerFactory::class,
                Worker\WorkerManager::class => Worker\WorkerManagerFactory::class,
            ],
        ];
    }
196635
public function update(Supervisor $supervisor)
    {
        $processes = $supervisor->processPools->mapWithKeys(function ($pool) use ($supervisor) {
            return [$supervisor->options->connection.':'.$pool->queue() => count($pool->processes())];
        })->toJson();

        $this->connection()->pipeline(function ($pipe) use ($supervisor, $processes) {
            $pipe->hmset(
                'supervisor:'.$supervisor->name, [
                    'name' => $supervisor->name,
                    'master' => explode(':', $supervisor->name)[0],
                    'pid' => $supervisor->pid(),
                    'status' => $supervisor->working ? 'running' : 'paused',
                    'processes' => $processes,
                    'options' => $supervisor->options->toJson(),
                ]
            );

            $pipe->zadd('supervisors',
                Chronos::now()->getTimestamp(), $supervisor->name
            );

            $pipe->expire('supervisor:'.$supervisor->name, 30);
        });
    }
507465
public function getOptionsDescriptions()
    {
        return array_merge(parent::getOptionsDescriptions(), [
            self::OPTION_NOSQL_DRIVER => ['The driver service to use to connect to the MongoDb instance', []],
            self::OPTION_COLLECTION_PREFIX => ['A string prefix used for collection names', []],
            self::OPTION_COLLECTION_NAME => ['The name of the collection in which the messages will be stored', []],
            self::OPTION_METHOD => ['Method to be executed in the consumer/producer', []],
        ]);
    }
695408
public function getCertificatesAsArray()
    {
        // Iterate over certificates nodes and convert to an array
        $certificates = array();
        /** @var \AppserverIo\Appserver\Core\Api\Node\CertificateNode $certificateNode */
        foreach ($this->getCertificates() as $certificateNode) {
            // restructure to an array
            $certificates[] = array(
                'domain' => $certificateNode->getDomain(),
                'certPath' => $certificateNode->getCertPath()
            );
        }

        // return certificates array
        return $certificates;
    }
787729
protected function getOptions()
    {
        return array(
            array('direction', 'd', InputOption::VALUE_OPTIONAL, 'The direction of ordering.', 'asc'),
            array('database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'),
            array('pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'),
            array('force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'),
            array('seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'),
        );
    }