API / Minn\Rest / RouteIndex

RouteIndex final class

Minn\Rest\RouteIndex · public/minn/src/Minn/Rest/RouteIndex.php · 61 lines

The description of one route the REST index publishes: namespace, methods, endpoints with their argument schemas, self link.

Constants and properties

privateSCHEMA_KEYWORDS = array ( 0 => 'default', 1 => 'enum', 2 => 'description', 3 => 'type', 4 => 'items', 5 => 'minimum', 6 => 'maximum', 7 => 'exclusiveMinimum', 8 => 'exclusiveMaximum', 9 => 'minLength', 10 => 'maxLength', 11 => 'pattern', 12 => 'format', 13 => 'properties', 14 => 'additionalProperties', 15 => 'oneOf', 16 => 'anyOf', 17 => 'minItems', 18 => 'maxItems', 19 => 'uniqueItems', )

Public

staticdescribe(string $route, array $callbacks, array $options, string $context, callable $restUrl): ?array#

One route as the index describes it, or null when hidden.

$callbackslist<array<string, mixed>>the route's handler groups
$optionsarray<string, mixed>the route's non-numeric options (namespace, schema)
$restUrlcallable(string): string
@return array<string, mixed>|null null when no endpoint shows in the index

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateargument(mixed $spec): array#

The published shape keeps the argument's own key order and puts `required` last.