Consolidation\Cgr\Application::getCommandsToExec PHP Метод

getCommandsToExec() публичный Метод

Return an array containing a list of commands to execute. Depending on the composition of the aguments and projects parameters, this list will contain either a single command string to call through to composer (if cgr is being used as a composer alias), or it will contain a list of appropriate replacement 'composer global require' commands that install each project in its own installation directory, while installing each projects' binaries in the global Composer bin directory, ~/.composer/vendor/bin.
public getCommandsToExec ( $command, array $composerArgs, array $projects, array $options ) : CommandToExec
$composerArgs array
$projects array
$options array
Результат CommandToExec
    public function getCommandsToExec($command, $composerArgs, $projects, $options)
    {
        $execPath = $options['composer-path'];
        // If command was not 'global require', 'global update' or
        // 'global remove', then call through to the standard composer
        // with all of the original args.
        if (empty($command)) {
            return array(new CommandToExec($execPath, $composerArgs));
        }
        // Call requireCommand, updateCommand, or removeCommand, as appropriate.
        $methodName = "{$command}Command";
        if (method_exists($this, $methodName)) {
            return $this->{$methodName}($execPath, $composerArgs, $projects, $options);
        } else {
            // If there is no specific implementation for the requested command, then call 'generalCommand'.
            return $this->generalCommand($command, $execPath, $composerArgs, $projects, $options);
        }
    }