1 | <?php |
||
20 | abstract class AbstractMethodInvocation extends AbstractInvocation implements MethodInvocation |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Instance of object for invoking or class name for static call |
||
25 | * |
||
26 | * @var object|string |
||
27 | */ |
||
28 | protected $instance; |
||
29 | |||
30 | /** |
||
31 | * Instance of reflection method for class |
||
32 | * |
||
33 | * @var ReflectionMethod |
||
34 | */ |
||
35 | protected $reflectionMethod; |
||
36 | |||
37 | /** |
||
38 | * Name of the invocation class |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $className = ''; |
||
43 | |||
44 | /** |
||
45 | * Constructor for method invocation |
||
46 | * |
||
47 | * @param string $className Class name |
||
48 | * @param string $methodName Method to invoke |
||
49 | * @param $advices array List of advices for this invocation |
||
50 | */ |
||
51 | 22 | public function __construct($className, $methodName, array $advices) |
|
62 | |||
63 | /** |
||
64 | * Invokes current method invocation with all interceptors |
||
65 | * |
||
66 | * @param null|object|string $instance Invocation instance (class name for static methods) |
||
67 | * @param array $arguments List of arguments for method invocation |
||
68 | * @param array $variadicArguments Additional list of variadic arguments |
||
69 | * |
||
70 | * @return mixed Result of invocation |
||
71 | */ |
||
72 | 20 | final public function __invoke($instance = null, array $arguments = [], array $variadicArguments = []) |
|
100 | |||
101 | /** |
||
102 | * Gets the method being called. |
||
103 | * |
||
104 | * @return AnnotatedReflectionMethod the method being called. |
||
105 | */ |
||
106 | 2 | public function getMethod() |
|
110 | |||
111 | /** |
||
112 | * Returns the object that holds the current joinpoint's static |
||
113 | * part. |
||
114 | * |
||
115 | * @return object|string the object for dynamic call or string with name of scope |
||
116 | */ |
||
117 | public function getThis() |
||
121 | |||
122 | /** |
||
123 | * Returns the static part of this joinpoint. |
||
124 | * |
||
125 | * @return object |
||
126 | */ |
||
127 | 1 | public function getStaticPart() |
|
131 | |||
132 | /** |
||
133 | * Returns friendly description of this joinpoint |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | final public function __toString() |
||
146 | } |
||
147 |