DataSift\Storyplayer\Cli\Script_Command::processCommand PHP Метод

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

public processCommand ( Phix_Project\CliEngine $engine, array $params = [], DataSift\Storyplayer\Injectables | null $injectables = null ) : integer
$engine Phix_Project\CliEngine
$params array
$injectables DataSift\Storyplayer\Injectables | null
Результат integer
    public function processCommand(CliEngine $engine, $params = array(), $injectables = null)
    {
        // we need to wrap our code to catch old-style PHP errors
        $legacyHandler = new Legacy_ErrorHandler();
        try {
            $returnCode = $legacyHandler->run([$this, 'processInsideLegacyHandler'], [$engine, $params, $injectables]);
            return $returnCode;
        } catch (Exception $e) {
            $injectables->output->logCliError($e->getMessage());
            $engine->options->dev = true;
            if (isset($engine->options->dev) && $engine->options->dev) {
                $injectables->output->logCliError("Stack trace is:\n\n" . $e->getTraceAsString());
            }
            exit(1);
        }
    }