src/Console/Routes/Controller.php
protected function processActionParams(&$actionId, &$params = [])
    {
        $actionMethod = $this->normalizeActionName($actionId);
        if (!empty($params)) {
            // populate options here so that they are available in beforeAction().
            $options = $this->options($actionId);
            if (isset($params['_aliases'])) {
                $optionAliases = $this->optionAliases();
                foreach ($params['_aliases'] as $name => $value) {
                    if (array_key_exists($name, $optionAliases)) {
                        $params[$optionAliases[$name]] = $value;
                    } else {
                        throw new Exception('Unknown alias: -{name}', ['name' => $name]);
                    }
                }
                unset($params['_aliases']);
            }
            foreach ($params as $name => $value) {
                // Allow camelCase options to be entered in kebab-case
                if (!in_array($name, $options, true) && strpos($name, '-') !== false) {
                    $kebabName = $name;
                    $altName = lcfirst(Inflector::id2camel($kebabName));
                    if (in_array($altName, $options, true)) {
                        $name = $altName;
                    }
                }

                if (in_array($name, $options, true)) {
                    $default = $this->$name;
                    if (is_array($default)) {
                        $this->$name = preg_split('/\s*,\s*(?![^()]*\))/', $value);
                    } elseif ($default !== null) {
                        settype($value, gettype($default));
                        $this->$name = $value;
                    } else {
                        $this->$name = $value;
                    }
                    $this->_passedOptions[] = $name;
                    unset($params[$name]);
                    if (isset($kebabName)) {
                        unset($params[$kebabName]);
                    }
                } elseif (!is_int($name)) {
                    throw new Exception('Unknown option: --{name}', ['name' => $name]);
                }
            }
        }
        $argsData = ReflectionHelper::checkMethodArguments($params, $actionMethod, $this);
        if (!empty($argsData)) {
            $errorMessage = $this->ansiFormat("Controller action arguments error\n", Console::FG_RED, Console::BOLD);
            foreach ($argsData as $argName => $error) {
                $argError = $error === ReflectionHelper::ARG_REQUIRED_MISSING
                    ? "Missing required argument"
                    : "Argument type mismatch";
                $errorMessage .= "\t - "
                    . $this->ansiFormat($argName, Console::FG_GREEN, Console::BOLD)
                    . " - " . $this->ansiFormat($argError, Console::FG_RED)
                    . "\n";
            }
            throw new \Reaction\Console\Exception($errorMessage);
        }
    }
protected function processActionParams(&$actionId, &$params = [])
    {
        $actionMethod = $this->normalizeActionName($actionId);
        if (!empty($params)) {
            // populate options here so that they are available in beforeAction().
            $options = $this->options($actionId);
            if (isset($params['_aliases'])) {
                $optionAliases = $this->optionAliases();
                foreach ($params['_aliases'] as $name => $value) {
                    if (array_key_exists($name, $optionAliases)) {
                        $params[$optionAliases[$name]] = $value;
                    } else {
                        throw new Exception('Unknown alias: -{name}', ['name' => $name]);
                    }
                }
                unset($params['_aliases']);
            }
            foreach ($params as $name => $value) {
                // Allow camelCase options to be entered in kebab-case
                if (!in_array($name, $options, true) && strpos($name, '-') !== false) {
                    $kebabName = $name;
                    $altName = lcfirst(Inflector::id2camel($kebabName));
                    if (in_array($altName, $options, true)) {
                        $name = $altName;
                    }
                }

                if (in_array($name, $options, true)) {
                    $default = $this->$name;
                    if (is_array($default)) {
                        $this->$name = preg_split('/\s*,\s*(?![^()]*\))/', $value);
                    } elseif ($default !== null) {
                        settype($value, gettype($default));
                        $this->$name = $value;
                    } else {
                        $this->$name = $value;
                    }
                    $this->_passedOptions[] = $name;
                    unset($params[$name]);
                    if (isset($kebabName)) {
                        unset($params[$kebabName]);
                    }
                } elseif (!is_int($name)) {
                    throw new Exception('Unknown option: --{name}', ['name' => $name]);
                }
            }
        }
        $argsData = ReflectionHelper::checkMethodArguments($params, $actionMethod, $this);
        if (!empty($argsData)) {
            $errorMessage = $this->ansiFormat("Controller action arguments error\n", Console::FG_RED, Console::BOLD);
            foreach ($argsData as $argName => $error) {
                $argError = $error === ReflectionHelper::ARG_REQUIRED_MISSING
                    ? "Missing required argument"
                    : "Argument type mismatch";
                $errorMessage .= "\t - "
                    . $this->ansiFormat($argName, Console::FG_GREEN, Console::BOLD)
                    . " - " . $this->ansiFormat($argError, Console::FG_RED)
                    . "\n";
            }
            throw new \Reaction\Console\Exception($errorMessage);
        }
    }
Process action params array
@param string $actionId
@param array  $params
@throws Exception