IControllerMethodReflector
in
Interface ControllerMethodReflector
You can inject this interface in your Middleware, and it will be prefilled with information related to the called controller method
Reads and parses annotations from doc comments (deprecated) and PHP attributes
Tags
Table of Contents
Methods
- getParameters() : array<string|int, mixed>
- getType() : string|null
- Inspects the PHPDoc parameters for types
- hasAnnotation() : bool
- Check if a method contains an annotation
- hasAnnotationOrAttribute() : bool
Methods
getParameters()
public
getParameters() : array<string|int, mixed>
this method is only used internally
Tags
Return values
array<string|int, mixed> —the arguments of the method with key => default value
getType()
Inspects the PHPDoc parameters for types
public
getType(string $parameter) : string|null
this method is only used internally
Parameters
- $parameter : string
-
the parameter whose type comments should be parsed
Tags
Return values
string|null —type in the type parameters (@param int $something) would return int or null if not existing
hasAnnotation()
Check if a method contains an annotation
public
hasAnnotation(string $name) : bool
will be obsolete with native attributes in PHP8
Parameters
- $name : string
-
the name of the annotation
Tags
Return values
bool —true if the annotation is found
hasAnnotationOrAttribute()
public
hasAnnotationOrAttribute(string|null $annotationName, T> $attributeClass) : bool
Parameters
- $annotationName : string|null
- $attributeClass : T>