1 | <?php |
||
19 | final class StaticClosureMethodInvocation extends AbstractMethodInvocation |
||
20 | { |
||
21 | /** |
||
22 | * Closure to use |
||
23 | * |
||
24 | * @var Closure |
||
25 | */ |
||
26 | protected $closureToCall; |
||
27 | |||
28 | /** |
||
29 | * Previous scope of invocation |
||
30 | * |
||
31 | * @var null|string |
||
32 | */ |
||
33 | protected $previousScope; |
||
34 | |||
35 | /** |
||
36 | * For static calls we store given argument as 'scope' property |
||
37 | */ |
||
38 | 13 | protected static $propertyName = 'scope'; |
|
39 | |||
40 | 13 | /** |
|
41 | 1 | * Proceeds all registered advices for the static method and returns an invocation result |
|
42 | */ |
||
43 | 1 | public function proceed() |
|
63 | |||
64 | /** |
||
65 | 13 | * Returns static method invoker for the concrete method in the class |
|
66 | 13 | */ |
|
67 | protected static function getStaticInvoker(string $className, string $methodName): Closure |
||
73 | |||
74 | /** |
||
75 | * Checks if the current joinpoint is dynamic or static |
||
76 | * |
||
77 | * Dynamic joinpoint contains a reference to an object that can be received via getThis() method call |
||
78 | * |
||
79 | * @see ClassJoinpoint::getThis() |
||
80 | */ |
||
81 | final public function isDynamic(): bool |
||
85 | |||
86 | /** |
||
87 | * Returns the object for which current joinpoint is invoked |
||
88 | * |
||
89 | * @return object Instance of object or null for static call/unavailable context |
||
90 | */ |
||
91 | final public function getThis(): ?object |
||
95 | |||
96 | /** |
||
97 | * Returns the static scope name (class name) of this joinpoint. |
||
98 | */ |
||
99 | final public function getScope(): string |
||
104 | } |
||
105 |