MacroThrowTypeExtension
class MacroThrowTypeExtension implements DynamicMethodThrowTypeExtension, DynamicStaticMethodThrowTypeExtension
Add a registered macro's exception to a method its @method tag types.
The tag owns the signature (see MacroMethodsClassReflectionExtension) but cannot declare exceptions, such as the ValidationException that Request::validate() throws. Only methods whose magic handler already declares an exception are claimed, because a supported extension replaces the method's exception, and returning none would drop it.
Methods
Create a macro throw type extension.
Determine whether the method is a tag-typed macro with a known exception.
Get the exception of the macro registered on the call's receiver.
Determine whether the static method is a tag-typed macro with a known exception.
Get the exception of the macro registered on the called class, or on a facade's root.
Details
at line 36
__construct(MacroMethodsClassReflectionExtension $macros, ReflectionProvider $reflectionProvider)
Create a macro throw type extension.
at line 45
bool
isMethodSupported(MethodReflection $methodReflection)
Determine whether the method is a tag-typed macro with a known exception.
at line 53
Type|null
getThrowTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope)
Get the exception of the macro registered on the call's receiver.
at line 64
bool
isStaticMethodSupported(MethodReflection $methodReflection)
Determine whether the static method is a tag-typed macro with a known exception.
at line 72
Type|null
getThrowTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope)
Get the exception of the macro registered on the called class, or on a facade's root.