@throws \RuntimeException

@param string $action

@return array
548640
protected function matchTypeAndDestination($action)
    {
        if (preg_match('#^([a-zA-Z0-9_]+):(.+)?$#', $action, $matches)) {
            $actionType = $matches[1];
            $actionValue = isset($matches[2]) ? $matches[2] : false;

            switch ($actionType) {
                case 'eznode':
                    $type = UrlAlias::LOCATION;
                    $destination = $actionValue;
                    break;

                case 'module':
                    $type = UrlAlias::RESOURCE;
                    $destination = $actionValue;
                    break;

                case 'nop':
                    $type = UrlAlias::VIRTUAL;
                    $destination = null;
                    break;

                default:
                    // @todo log message
                    throw new \RuntimeException("Action type '{$actionType}' is unknown");
            }
        } else {
            // @todo log message
            throw new \RuntimeException("Action '{$action}' is not valid");
        }

        return array($type, $destination);
    }
783025
public function getActionButtons($action, $object = null)
    {
        $list = $this->configureActionButtons($action, $object);

        foreach ($this->getExtensions() as $extension) {
            // TODO: remove method check in next major release
            if (method_exists($extension, 'configureActionButtons')) {
                $list = $extension->configureActionButtons($this, $list, $action, $object);
            }
        }

        return $list;
    }
783043
protected function getActionVariables(string $action): array
    {
        $modelName = $this->getModelName();

        $variables = [
            'className' => ucfirst(Str::camel($action)).'Request',
            'baseClass' => $action === 'index' ? 'PaginationRequest' : 'Request',
        ];

        return $variables;
    }
852239
public function loadAutogeneratedEntry($action, $parentId = null)
    {
        try {
            return $this->innerGateway->loadAutogeneratedEntry($action, $parentId);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
1125097
public function moduleForAction($action)
    {
        if (!isset($this->actions[$action])) {
            return null;
        }

        return $this->modules[$this->actions[$action]];
    }
1105728
protected function getFileContents($file)
    {
        // If the file is not readable
        if (!is_readable($file)) {
            throw new RuntimeException(
                sprintf(RuntimeException::INVALID_FILE_STR, $file),
                RuntimeException::INVALID_FILE
            );
        }

        return file_get_contents($file);
    }
1196168
protected function _mapAction($action) {
		$actionMap = $this->getConfig('actionMap');
		if (isset($actionMap[$action]) && method_exists($this, $actionMap[$action]['method'])) {
			$pass = (array)$this->_getRequest()->param('pass');
			call_user_func_array([$this, $actionMap[$action]['method']], $pass);

			if ($this->_redirectResponse instanceof Response) {
				return $this->_redirectResponse;
			}

			if (is_string($actionMap[$action]['view'])) {
				try {
					return $this->getController()->render($this->getController()->request->param('action'));
				} catch (MissingTemplateException $e) {
					return $this->getController()->render($actionMap[$action]['view']);
				}
			}

				return $this->_getResponse();
			}

		return false;
	}
117230
private function perform($action, $data)
    {
        if ($this->app->user->isGuest) {
            return [];
        }

        return Client::perform($action, $data);
    }
1307046
protected function findCallable(array $action)
    {
        return ArrayHelper::filter($action, function ($key, $value) {
            return is_callable($value) && is_numeric($key);
        });
    }
247663
static protected function fetchData(string $url): array {
        $url  .= '.json?key=' . urlencode(RC::get('redmineApiKey'));
        $data = file_get_contents($url);
        if ($data) {
            $data = (array) json_decode($data);
            $data = array_pop($data);
            return (array) $data;
        }
        throw new RuntimeException('Fetching data failed');
    }
616494
private function parseActionString(string $action){
        if(($pos = strpos($action, ":")) === false){
            throw new \InvalidArgumentException();
        }

        $controller = substr($action, 0, $pos);
        $method     = substr($action, $pos + 1);

        if(strlen($controller) === 0 || strlen($method) === 0){
            throw new \InvalidArgumentException();
        }

        if($this->container->has($controller)){
            $controller = $this->container->lazyGet($controller);
        }else if(class_exists($controller)){
            $controller = $this->container->lazyNew($controller);
        }else{
            throw new \InvalidArgumentException();
        }

        return [$controller, $method];
    }
332678
private function getSortedProcessors($action, $actionData, $groups)
    {
        $processors = [];
        foreach ($actionData as $priority => $priorityData) {
            foreach ($priorityData as $processor) {
                if (isset($processor[1][self::GROUP_ATTRIBUTE])) {
                    $group = $processor[1][self::GROUP_ATTRIBUTE];
                    if (!isset($groups[$action][$group])) {
                        throw new \RuntimeException(
                            \sprintf(
                                'The group "%s" is not defined. Processor: "%s".',
                                $group,
                                $processor[0]
                            )
                        );
                    }
                    $groupPriority = $groups[$action][$group];
                    $processorPriority = self::calculatePriority($priority, $groupPriority);
                } else {
                    $processorPriority = self::calculatePriority($priority);
                }
                $processors[$processorPriority][] = $processor;
            }
        }
        $processors = $this->sortByPriorityAndFlatten($processors);

        return $processors;
    }
923326
public function handle(string $action = null)
    {
        if (!$action)
        {
            $action = $this->request()->getAttribute($this->attribute);
        }

        if ($action === null)
        {
            throw new Path('Action `' . $this->attribute . '` name not found!');
        }

        if (!method_exists($this, $action))
        {
            throw new Runtime('Action `' . $action . '` not found');
        }

        $data = $this->$action(...$this->arguments());

        if (is_object($data) && $data instanceof Dispatcher)
        {
            return $data;
        }

        if (is_string($data) && class_exists($data))
        {
            return new $data($this->factory, $this, $this->cookies);
        }

        return $this->processing($data);
    }
1245877
protected function parseAction($action)
    {
        if ($action === $this->fullController) {
            return $this->action = null;
        }

        $this->action = strtolower(
            preg_replace(['/^get/', '/^post/', '/^put/', '/^patch/', '/^delete/'], '', $action)
        );
    }
164929
protected function parseAction($action)
	{
		// If the action is already a Closure instance, we will just set that instance
		// as the "uses" property, because there is nothing else we need to do when
		// it is available. Otherwise we will need to find it in the action list.
		if (is_callable($action))
		{
			return array('uses' => $action);
		}

		// If no "uses" property has been set, we will dig through the array to find a
		// Closure instance within this list. We will set the first Closure we come
		// across into the "uses" property that will get fired off by this route.
		elseif ( ! isset($action['uses']))
		{
			$action['uses'] = $this->findCallable($action);
		}

		return $action;
	}
681480
public function query(string $statement) : array
    {
        try {
            return $this->getConnection()->query($statement)->fetchAll(\PDO::FETCH_ASSOC);
        } catch (\PDOException $e) {
            throw new ParserRuntimeException('Statement could not be executed.', 0, $e);
        }
    }
991495
public function getRules($action = null){

        $rules = $this->rules;

        if( isset($this->rules[$action]) ){
            $rules = $this->rules[$action];
        }

        return $this->parserValidationRules($rules, $this->id);
    }