/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Command
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Command/RoutesGenerateCommand.php (3079B)
_splitArgs($args->getArguments());
$url = Router::url($args);
$io->out("> $url");
$io->out();
} catch (MissingRouteException $e) {
$io->err('
The provided parameters do not match any routes.');
$io->out();
return static::CODE_ERROR;
}
return static::CODE_SUCCESS;
}
/**
* Split the CLI arguments into a hash.
*
* @param array
$args The arguments to split.
* @return array
*/
protected function _splitArgs(array $args): array
{
$out = [];
foreach ($args as $arg) {
if (strpos($arg, ':') !== false) {
[$key, $value] = explode(':', $arg);
if (in_array($value, ['true', 'false'], true)) {
$value = $value === 'true';
}
$out[$key] = $value;
} else {
$out[] = $arg;
}
}
return $out;
}
/**
* Get the option parser.
*
* @param \Cake\Console\ConsoleOptionParser $parser The option parser to update
* @return \Cake\Console\ConsoleOptionParser
*/
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
$parser->setDescription(
'Check a routing array against the routes. ' .
'Will output the URL if there is a match.' .
"\n\n" .
'Routing parameters should be supplied in a key:value format. ' .
'For example `controller:Articles action:view 2`'
);
return $parser;
}
}