Index

Command

MMO\core\attributes · 1 symbol · generated 5 Oct 2026

class

Command

Command.php:15

An APIRoute specialized for CLI subcommands (method 'SHELL', matching any path via '**') -- see

#[Attribute(6)] class MMO\core\attributes\Command extends MMO\core\attributes\APIRoute
Namespace
MMO\core\attributes
Extends
APIRoute
See
aShellController.
#[Command(['name' => 'string'], 'say hello')] public function routeHello(Route $route): void {...} // `php script.php routeHello --name=Marc`

Methods1

__construct($body, $info, $mediaTypes, $order)

Command.php:22
function __construct( array $body, array|string $info = [], array $mediaTypes = ['text'], int $order = 0 )
$bodyarraythe command's named arguments, key => (template string | Schema)
$info = []array | stringa description, or a full OpenAPI-style info array
$mediaTypes = ['text']array
$order = 0int
Inherited members (53)
PropertiesDeclared byDescription
bodyAPIRoute
cookieAPIRoute
fragmentAPIRoute
headerAPIRoute
infoAPIRoute
methodAPIRoute
optsAPIRoute
orderAPIRoute
pathAPIRoute
queryAPIRoute
MethodsDeclared byDescription
addAPIParameter($parameters, $info)APIRoute
addAPIParameters($params, $in)APIRoute
addInfo($info, $default)APIRouteAdd information to the route
addOptions($opts, $appendList)APIRouteMerge $opts into the existing options (through merge), rather than replacing them wholesale like setOptions.
api()APIRouteBuild this route's OpenAPI operation object (path parameters, query/header/cookie parameters, request body, merged with any extra addInfo info).
clearOptions()APIRouteEmpty the options bag.
createRequest($data, $method)APIRouteBuild a real Request matching this route, useful to synthesize/test a call without going through HTTP.
debugName()APIRoute
getBody($data)APIRoute
getCookie($data)APIRoute
getFragment()APIRoute
getHeader($data)APIRoute
getInfo($key, $default)APIRoute
getMethod()APIRoute
getOperation()APIRoute
getOption($key, $default)APIRoute
getOptions()APIRoute
getOrder()APIRoute
getParameters($in, $data)APIRoute
getPath()APIRoute
getQuery($data)APIRoute
getUrl($data, $absolute)APIRouteGet path url. If no data are passed, it return a relative url with placeholders
hasInfo($key)APIRoute
isHidden()APIRoute
jsonSerialize()APIRoute
match($request, $matches)APIRouteCheck if a request match this path.
setBasepath($path)APIRoute
setBody($value)APIRoute
setCookie($value)APIRoute
setFragment($fragment)APIRoute
setHeader($value)APIRoute
setMethod($method)APIRoute
setOperation($id)APIRoute
setOption($key, $value)APIRouteSet (or, with a null $value, remove) a single option.
setOptions($opts)APIRouteReplace the whole options bag.
setOrder($value)APIRoute
setParameters($in, $value)APIRouteSet parameters capture information
setPath($path)APIRouteSame as From, except wildcard are converted to placeholders
setQuery($value)APIRoute
setUrl($url)APIRouteParse a full {method}|{path}?{query}#{fragment} route URL (see this class's own docblock for the format) and set every corresponding property (method, path, query, fragment) from it.
toLink($data, $rels)APIRoute
uid()APIRoute
__toString()APIRoute