1 | <?php |
||
19 | final class DynamicClosureMethodInvocation extends AbstractMethodInvocation |
||
20 | { |
||
21 | /** |
||
22 | * Closure to use |
||
23 | * |
||
24 | * @var \Closure |
||
25 | */ |
||
26 | protected $closureToCall; |
||
27 | |||
28 | /** |
||
29 | * Previous instance of invocation |
||
30 | * |
||
31 | * @var null|object |
||
32 | */ |
||
33 | protected $previousInstance; |
||
34 | |||
35 | /** |
||
36 | * For dynamic calls we store given argument as 'instance' property |
||
37 | */ |
||
38 | 7 | protected static $propertyName = 'instance'; |
|
39 | |||
40 | 7 | /** |
|
41 | 1 | * Invokes original method and return result from it |
|
42 | * |
||
43 | 1 | * @return mixed |
|
44 | */ |
||
45 | public function proceed() |
||
67 | |||
68 | /** |
||
69 | * Returns the object for which current joinpoint is invoked |
||
70 | * |
||
71 | * @return object Instance of object or null for static call/unavailable context |
||
72 | */ |
||
73 | final public function getThis(): ?object |
||
77 | |||
78 | /** |
||
79 | * Checks if the current joinpoint is dynamic or static |
||
80 | * |
||
81 | * Dynamic joinpoint contains a reference to an object that can be received via getThis() method call |
||
82 | * @see ClassJoinpoint::getThis() |
||
83 | */ |
||
84 | final public function isDynamic(): bool |
||
88 | |||
89 | /** |
||
90 | * Returns the static scope name (class name) of this joinpoint. |
||
91 | */ |
||
92 | final public function getScope(): string |
||
98 | } |
||
99 |