Run the callable if it's set. This can be overridden by implementing the run method on a Command class.

@return mixed
342152
public function run()
    {
        $callable = $this->getCallable();
        if (is_callable($callable)) {
            return $callable($this->app, $this->output, $this->input, $this->parameter);
        }
        return false;
    }
177116
public function run()
    {
        //check sub controller
        foreach ($this->controllers as $controller) {
            if ($result = $controller->run()) {
                return $result;
            }
        }

        $requestedUrl = $this->getClient()->getUrl();
        $this->normalizeUrl($requestedUrl);
        //check if its in our area
        if (strpos($requestedUrl, $this->triggerUrl) !== 0) return;

        $endPos = $this->triggerUrl === '/' ? 1 : strlen($this->triggerUrl) + 1;
        $uri = substr($requestedUrl, $endPos);

        if (!$uri) $uri = '';

        $route = false;
        $arguments = array();
        $requiredMethod = $this->getClient()->getMethod();

        //does the requested uri exist?
        list($callableMethod, $regexArguments, $method, $routeUri) = $this->findRoute($uri, $requiredMethod);

        if ((!$callableMethod || $method != 'options') && $requiredMethod == 'options') {
            $description = $this->describe($uri);
            $this->send($description);
        }

        if (!$callableMethod) {
            if (!$this->getParentController()) {
                if ($this->fallbackMethod) {
                    $m = $this->fallbackMethod;
                    $this->send($this->controller->$m());
                } else {
                    return $this->sendBadRequest('RouteNotFoundException', "There is no route for '$uri'.");
                }
            } else {
                return false;
            }
        }

        if ($method == '_all_')
            $arguments[] = $method;

        if (is_array($regexArguments)) {
            $arguments = array_merge($arguments, $regexArguments);
        }

        //open class and scan method
        if ($this->controller && is_string($callableMethod)) {
            $ref = new \ReflectionClass($this->controller);

            if (!method_exists($this->controller, $callableMethod)) {
                $this->sendBadRequest('MethodNotFoundException', "There is no method '$callableMethod' in ".
                    get_class($this->controller).".");
            }

            $reflectionMethod = $ref->getMethod($callableMethod);
        } else if (is_callable($callableMethod)) {
            $reflectionMethod = new \ReflectionFunction($callableMethod);
        }

        $params = $reflectionMethod->getParameters();

        if ($method == '_all_') {
            //first parameter is $pMethod
            array_shift($params);
        }

        //remove regex arguments
        for ($i=0; $i<count($regexArguments); $i++) {
            array_shift($params);
        }

        //collect arguments
        foreach ($params as $param) {
            $name = $this->argumentName($param->getName());

            if ($name == '_') {
                $thisArgs = array();
                foreach ($_GET as $k => $v) {
                    if (substr($k, 0, 1) == '_' && $k != '_suppress_status_code')
                        $thisArgs[$k] = $v;
                }
                $arguments[] = $thisArgs;
            } else {

                if (!$param->isOptional() && !isset($_GET[$name]) && !isset($_POST[$name])) {
                    return $this->sendBadRequest('MissingRequiredArgumentException', sprintf("Argument '%s' is missing.", $name));
                }

                $arguments[] = isset($_GET[$name]) ? $_GET[$name] : (isset($_POST[$name]) ? $_POST[$name] : $param->getDefaultValue());
            }
        }

        if ($this->checkAccessFn) {
            $args[] = $this->getClient()->getUrl();
            $args[] = $route;
            $args[] = $arguments;
            try {
                call_user_func_array($this->checkAccessFn, $args);
            } catch (\Exception $e) {
                $this->sendException($e);
            }
        }

        //fire method
        $object = $this->controller;

        return $this->fireMethod($callableMethod, $object, $arguments);

    }
525489
public function run()
    {
        $url = parse_url($_SERVER['REQUEST_URI']);

        $controller = $this->router->find($url['path']);
        if (!$controller instanceof ControllerInterface) {
            throw new \RuntimeException('No valid controller found.');
        }

        $controller->setServer($this);

        $result = $controller->execute();

        $data = json_encode($result);

        if (array_key_exists('callback', $_GET)) {
            $data = $_GET['callback'] . '(' . $data . ')';
        }
        
        return $data;
    }
1173487
protected function runCommands()
    {
        // Load Remote directory
        $remote    = $this->argument('remote');
        $directory = Config::get('remote.connections.'.$remote.'.root');

        // Define commands
        $commands = array_merge(['cd '.$directory], Config::get('vdeploy::config.commands'));
        $commands = array_filter($commands);

        // Parse tags in command
        if (!$this->parseTags($commands)) {
            return false;
        }

        // Run Commands
        SSH::into($remote)->run($commands);

        return true;
    }
1137111
public function run() {
        $helperSet = $this->getConsoleHelperSet();
        ConsoleRunner::run($helperSet, $this->getConsoleCommands($helperSet));
    }
1349984
public function run()
    {
        // Select the action to perform depending on the 'action' parameter.
        // Verification of the value of 'action' performed in self::preRun().
        $actions = $this->getAllowedActions();
        $pendingActionName = 'action' . $actions[$this->options['action']];
        if (method_exists($this, $pendingActionName)) {
            return $this->$pendingActionName();
        }
    }
355581
protected function run()
    {
        if (PHP_SAPI === 'cli') {
            return;
        }
        
        if ($this->ctrlRouterInfos->target === null) {
            return;
        }
        
        $this->module
            ->monolog
            ->getLogger()
            ->debug(
                'Execute current route.',
                ['target' => $this->ctrlRouterInfos->target]
            );
        
        $useClass = $this->config->getValue('useClass');
        
        if ($useClass === true) {
            $this->runObject();
        } else {
            $this->runProcedural();
        }
    }
940472
public function run()
    {
        if (!$this->overrideFile()) {
            $this->output->writeln("<info>File was skipped. The controller was not created.</info>");
            return true;
        }
        $data = $this->getControllerMetaData()->getData();
        $data = array_merge(
            $data,
            [
                'controllerName' => $this->controllerName,
                'namespace' => $this->namespace,
                'basePath' => $this->getBasePath()
            ]
        );
        $content = $this->getTemplateEngine()
            ->parse($this->template)
            ->process($data);
        file_put_contents($this->getControllerFile(), $content);
        return true;
    }
1007018
protected function doRun()
    {
        $result = 0;
        $args = func_get_args();
        $host = $this->session->getHost();

        if (count($args) === 3) {
            list($method, $params, $retval) = $args;

            // Strip namespace 
            $method = trim(str_replace(__NAMESPACE__, '', $method),'\\');
            $command = $method.' => ['.implode(' , ', $params).']';
            $this->printOut('<comment>' . $host . '</comment> < <info>' . $command.'</info>');

            // Initial result evaluation
            $result = $retval;
            $halt = $result == false;

            // Prints process information
            // @codeCoverageIgnoreStart
            if ($halt) {
                $this->printOut('<error>Aborted</error>');
            } else {
                if (is_string($retval) || is_array($retval)) {

                    if(is_array($retval)) {
                        foreach ($retval as $key => $val) {
                            if ( ! is_numeric($key)) $resultDioArray[] = $key.':'.$val;
                        }
                    } else {
                        $resultDioArray = array_filter(explode("\n", $retval));
                    }


                    foreach ($resultDioArray as $i => $resultDioLine) {
                        $this->printOut((($i === 0) ? '<comment>'.$host.'</comment>' : str_pad(' ', strlen($host))).' > <info>'.$resultDioLine.'</info>');
                    }
                } else {
                    $this->printOut('<comment>'.$host.'</comment> > <info>[OK]</info>');
                }
            }
            // @codeCoverageIgnoreEnd
        }

        return $result;
    }
148457
public function run()
    {
        switch ($this->status) {
            case self::STATUS_ENDED:
                // We've already ended, lets just return
                return;

            case self::STATUS_INACTIVE:
                throw new \RuntimeException('Runtime has not yet booted.');
        }

        $runner = $this->getRunner();
        $response = $runner->run();

        if ($response) {
            $this->sendResponse($response);
        }

        return $response;
    }
193580
public function run()
    {
        $this->extractInteractions();

        $this->data = $line = [];

        foreach ($this->interactions as $interaction) {
            foreach ($this->columns as $column => $config) {
                if (isset($config['callback'])
                    && method_exists($this, $config['callback']))
                {
                    $params = [];
                    if (isset($config['callbackParameters'])) {
                        $params = $config['callbackParameters'];
                    }
                    $functionCall = $config['callback'];
                    $callbackValue = call_user_func(array($this, $functionCall), $interaction, $params);
                    if (isset($config['valuesAsColumns'])) {
                        $line[$interaction['id']] = array_merge($line[$interaction['id']], $callbackValue);
                    } else {
                        $line[$interaction['id']][$column] = $callbackValue;
                    }
                }
            }
        }
        $this->data = $line;
        $this->columns = $this->interactions = [];
        return $this;
    }
129227
public function run()
    {
        $this->validateOperations();
        $this->prepareTransport();
        $this->prepareTokenHelper();
        $this->preparePayloadAuth();

        try {
            $this->runApiOperations();
        } catch (\Exception $e) {
            if (
                $this->start
                && $e instanceof ContactClientException
                && Stat::TYPE_AUTH === $e->getStatType()
            ) {
                // We failed the pre-auth run due to an auth-related issue. Flush the tokenHelper.
                $this->prepareTokenHelper();
                // Try a standard run from the top assuming authentication is needed again.
                $this->start = 0;
                $this->runApiOperations();
            } else {
                throw $e;
            }
        }

        return $this;
    }
123245
public function run()
    {
        if (! $this->runPreSearch()) {
            return $this->value;
        }

        $decoded = json_decode($this->value, 1);
        $result  = (json_last_error() == JSON_ERROR_NONE) && is_array($decoded);
        if ($result) {
            /* decoded is array */
            if (is_array($decoded)) {
                $arrayValue = '';
                array_walk_recursive($decoded, function ($value, $key) use (&$arrayValue) {
                    $arrayValue .= $key.' '.$value;
                });
                $this->value = $arrayValue;
            }
        }

        return $this->value;
    }
467165
public function run()
    {
        parent::run();

        while (\count($this->running) || \count($this->pending)) {
            foreach ($this->running as $key => $test) {
                try {
                    if (!$this->testIsStillRunning($test)) {
                        unset($this->running[$key]);
                        $this->releaseToken($key);
                    }
                } catch (\Exception $e) {
                    if ($this->options->verbose) {
                        echo "An error for $key: {$e->getMessage()}" . PHP_EOL;
                        echo "Command: {$test->getLastCommand()}" . PHP_EOL;
                        echo 'StdErr: ' . $test->getStderr() . PHP_EOL;
                        echo 'StdOut: ' . $test->getStdout() . PHP_EOL;
                    }
                    throw $e;
                }
            }
            $this->fillRunQueue();
            usleep(10000);
        }
        $this->complete();
    }
670020
public function run()
    {
        $values = str_split($this->value);
        foreach ($values as $item) {
            if (ord($item) >= 127) {
                $this->value = str_replace($item, ' ', $this->value);
            }
        }

        return $this->value;
    }
1330836
public function runAction()
    {
        $args = $this->getRequest()->getArgv();
        if (!isset($args[2], $args[3])) {
            return $this->help('run');
        }
        $request = new VirtualRequest($args[2], $args[3]);
        $response = $this->dispatch($request);
        if ($response->getCode() !== 200) {
            $response->setContent("Wrong arguments provided\n");
        }

        return $response;
    }
130538
public final function run()
    {
        $this->registerServices();
        $this->registerCommands();
        return $this->symfonyApplication->run($this->input, $this->output);
    }