API_ANNOTATION_PATH
API_ANNOTATION_PATH
The file path where the @Api annotation is setup
This classe resolves URL routing by using annotations on methods.
It specifies a pattern that, when matched, triggers that operation.
$routes : array<mixed,\PhpApi\Route>
Holds all @Api routes.
It stores the pattern that triggers the route, class and function that will be executed, moreover the specific HTTP method used for that function
addRoute(\ReflectionMethod $method, \PhpApi\Annotations\Api $api, \PhpApi\Annotations\HttpMethod $httpMethod = null)
Adds the route and pattern for a given $method using a specific HTTP request method if available
| \ReflectionMethod | $method | The class method that will be triggered |
| \PhpApi\Annotations\Api | $api | The $method @Api annotation |
| \PhpApi\Annotations\HttpMethod | $httpMethod | The $method @HttpMethod Annotation |
getRoute(string $pattern) : \PhpApi\Route
Returns the route for a given pattern
| string | $pattern | The pattern |
The route