1 | <?php |
||
22 | class ReflectionConstructorInvocation extends AbstractInvocation implements ConstructorInvocation |
||
23 | { |
||
24 | /** |
||
25 | * Reflection class |
||
26 | * |
||
27 | * @var ReflectionClass |
||
28 | */ |
||
29 | protected $class; |
||
30 | |||
31 | /** |
||
32 | * Instance of created class, can be used for Around or After types of advices |
||
33 | * |
||
34 | * @var object|null |
||
35 | */ |
||
36 | protected $instance; |
||
37 | |||
38 | /** |
||
39 | * Instance of reflection constructor for class |
||
40 | * |
||
41 | * @var null|ReflectionMethod |
||
42 | */ |
||
43 | private $constructor; |
||
44 | |||
45 | /** |
||
46 | * Constructor for constructor invocation :) |
||
47 | * |
||
48 | * @param array $advices List of advices for this invocation |
||
49 | 1 | */ |
|
50 | public function __construct(string $className, string $unusedType, array $advices) |
||
67 | |||
68 | /** |
||
69 | * Proceed to the next interceptor in the Chain |
||
70 | * |
||
71 | * Typically this method is called inside previous closure, as instance of Joinpoint is passed to callback |
||
72 | * Do not call this method directly, only inside callback closures. |
||
73 | * |
||
74 | * @return mixed |
||
75 | */ |
||
76 | final public function proceed() |
||
93 | |||
94 | /** |
||
95 | * Gets the constructor being called or null if it is absent. |
||
96 | */ |
||
97 | public function getConstructor(): ?ReflectionMethod |
||
101 | |||
102 | /** |
||
103 | * Returns the object for which current joinpoint is invoked |
||
104 | * |
||
105 | * @return object|null Instance of object or null for static call/unavailable context |
||
106 | */ |
||
107 | public function getThis(): ?object |
||
111 | |||
112 | /** |
||
113 | * Invokes current constructor invocation with all interceptors |
||
114 | * |
||
115 | * @return mixed |
||
116 | */ |
||
117 | final public function __invoke(array $arguments = []) |
||
124 | |||
125 | /** |
||
126 | * Checks if the current joinpoint is dynamic or static |
||
127 | * |
||
128 | * Dynamic joinpoint contains a reference to an object that can be received via getThis() method call |
||
129 | * |
||
130 | * @see ClassJoinpoint::getThis() |
||
131 | */ |
||
132 | public function isDynamic(): bool |
||
136 | |||
137 | /** |
||
138 | * Returns the static scope name (class name) of this joinpoint. |
||
139 | */ |
||
140 | public function getScope(): string |
||
144 | |||
145 | /** |
||
146 | * Returns a friendly description of current joinpoint |
||
147 | */ |
||
148 | final public function __toString(): string |
||
155 | } |
||
156 |