1 | <?php |
||
25 | abstract class AbstractMethodInvocation extends AbstractInvocation implements MethodInvocation |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Instance of object for invoking |
||
30 | * |
||
31 | * @var object|null |
||
32 | */ |
||
33 | protected $instance; |
||
34 | |||
35 | /** |
||
36 | * Instance of reflection method for class |
||
37 | * |
||
38 | * @var ReflectionMethod |
||
39 | */ |
||
40 | protected $reflectionMethod; |
||
41 | |||
42 | /** |
||
43 | * Class name scope for static invocation |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $scope; |
||
48 | |||
49 | /** |
||
50 | * This static variable holds the name of field to use to avoid extra "if" section in the __invoke method |
||
51 | 24 | * |
|
52 | * Overridden in children classes and initialized via LSB |
||
53 | 24 | * |
|
54 | 24 | * @var string |
|
55 | 24 | */ |
|
56 | protected static $propertyName; |
||
57 | |||
58 | 24 | /** |
|
59 | 4 | * Constructor for method invocation |
|
60 | * |
||
61 | 24 | * @param array $advices List of advices for this invocation |
|
62 | */ |
||
63 | public function __construct(string $className, string $methodName, array $advices) |
||
73 | |||
74 | 20 | /** |
|
75 | 2 | * Invokes current method invocation with all interceptors |
|
76 | * |
||
77 | * @param null|object|string $instance Invocation instance (class name for static methods) |
||
78 | 20 | * @param array $arguments List of arguments for method invocation |
|
79 | * @param array $variadicArguments Additional list of variadic arguments |
||
80 | * |
||
81 | * @return mixed Result of invocation |
||
82 | */ |
||
83 | 20 | final public function __invoke($instance = null, array $arguments = [], array $variadicArguments = []) |
|
113 | |||
114 | /** |
||
115 | * Gets the method being called. |
||
116 | * |
||
117 | * @return ReflectionMethod|AnnotatedReflectionMethod the method being called. |
||
118 | */ |
||
119 | public function getMethod(): ReflectionMethod |
||
123 | |||
124 | /** |
||
125 | 1 | * Returns friendly description of this joinpoint |
|
126 | */ |
||
127 | 1 | final public function __toString(): string |
|
136 | } |
||
137 |