src/Framework/App.php
private function detectAction(string $className, array $variables = []): string
    {
        $action =
            // 1. Action name in line with class name eg. MyApp\Index:test - alias for `action_test`
            $this->extractActionFromClass($className)
            ?? (
                // 2. If action name in variables (we need first item)
                $variables['action'][0]
                // 3. Default action is index
                ?? self::DEFAULT_ACTION
            );

        return 'action_' . $action;
    }
private function detectAction(string $className, array $variables = []): string
    {
        $action =
            // 1. Action name in line with class name eg. MyApp\Index:test - alias for `action_test`
            $this->extractActionFromClass($className)
            ?? (
                // 2. If action name in variables (we need first item)
                $variables['action'][0]
                // 3. Default action is index
                ?? self::DEFAULT_ACTION
            );

        return 'action_' . $action;
    }
private function detectAction ( string $ className , array $ variables = [ ] ) : string { $ action = // 1. Action name in line with class name eg. MyApp\Index:test - alias for `action_test` $ this -> extractActionFromClass ( $ className ) ?? ( // 2. If action name in variables (we need first item) $ variables [ 'action' ] [ 0 ] // 3. Default action is index ?? self :: DEFAULT_ACTION ) ; return 'action_' . $ action ; }
Detect action by string name, variable or use default

@param   string $className - eg. MyApp\Index:test
@param   array $variables
@return  string
Detect action by string name variable or use default