1 | <?php |
||
5 | abstract class ReflectionFunctionAbstract extends Reflection |
||
6 | { |
||
7 | use Parts\DocCommentTrait; |
||
8 | |||
9 | protected $parameters = []; |
||
10 | protected $staticVariables = []; |
||
11 | protected $returnsByRef = false; |
||
12 | protected $isGenerator = false; |
||
13 | |||
14 | /** |
||
15 | * Get the parameters. |
||
16 | * |
||
17 | * @return Benoth\StaticReflection\Reflection\ReflectionParameter[] |
||
18 | */ |
||
19 | 45 | public function getParameters() |
|
23 | |||
24 | /** |
||
25 | * Get a parameter by its name. |
||
26 | * |
||
27 | * @param string $parameterSearchedName The parameter name to reflect |
||
28 | * |
||
29 | * @throws \ReflectionException If the parameter does not exist |
||
30 | * |
||
31 | * @return Benoth\StaticReflection\Reflection\ReflectionParameter |
||
32 | */ |
||
33 | 36 | public function getParameter($parameterSearchedName) |
|
43 | |||
44 | /** |
||
45 | * Checks whether the function returns a reference. |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | 6 | public function returnsByRef() |
|
53 | |||
54 | /** |
||
55 | * Checks whether the function returns a reference. |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function returnsReference() |
||
63 | |||
64 | /** |
||
65 | * Get the number of parameters that a function defines, both optional and required. |
||
66 | * |
||
67 | * @return int |
||
68 | */ |
||
69 | public function getNumberOfParameters() |
||
73 | |||
74 | /** |
||
75 | * Get the number of required parameters that a function defines. |
||
76 | * |
||
77 | * @return int |
||
78 | */ |
||
79 | public function getNumberOfRequiredParameters() |
||
91 | |||
92 | /** |
||
93 | * Get the static variables. |
||
94 | * |
||
95 | * @return array An array of static variables, variable name as key, value as value |
||
96 | */ |
||
97 | public function getStaticVariables() |
||
101 | |||
102 | /** |
||
103 | * Checks whether the reflected function has a return type specified. |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function hasReturnType() |
||
112 | |||
113 | /** |
||
114 | * Checks whether the reflected function is a Closure. |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function isClosure() |
||
122 | |||
123 | /** |
||
124 | * Checks whether the function is deprecated. |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | 3 | public function isDeprecated() |
|
132 | |||
133 | /** |
||
134 | * Returns whether this function is a generator. |
||
135 | * |
||
136 | * @return bool |
||
137 | */ |
||
138 | 3 | public function isGenerator() |
|
142 | |||
143 | /** |
||
144 | * Checks if class is defined internally by an extension, or the core. |
||
145 | * |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function isInternal() |
||
152 | |||
153 | /** |
||
154 | * Checks if class is user defined. |
||
155 | * |
||
156 | * @return bool |
||
157 | */ |
||
158 | public function isUserDefined() |
||
162 | |||
163 | /** |
||
164 | * Checks if the function is variadic. |
||
165 | * |
||
166 | * @return bool |
||
167 | */ |
||
168 | public function isVariadic() |
||
178 | |||
179 | /** |
||
180 | * Returns the scope associated to the closure. |
||
181 | * |
||
182 | * @throws \ReflectionException Always... Can't be implemented. |
||
183 | * |
||
184 | * @return bool |
||
185 | */ |
||
186 | public function getClosureScopeClass() |
||
190 | |||
191 | /** |
||
192 | * Returns this pointer bound to closure. |
||
193 | * |
||
194 | * @throws \ReflectionException Always... Can't be implemented. |
||
195 | * |
||
196 | * @return bool |
||
197 | */ |
||
198 | public function getClosureThis() |
||
202 | |||
203 | /** |
||
204 | * Returns a dynamically created closure for the method. |
||
205 | * |
||
206 | * @throws \ReflectionException Always... Can't be implemented. |
||
207 | * |
||
208 | * @return \Closure|null Returns NULL in case of an error. |
||
209 | */ |
||
210 | public function getClosure() |
||
214 | |||
215 | /** |
||
216 | * Invokes a reflected method. |
||
217 | * |
||
218 | * |
||
219 | * @param object $object The object to invoke the method on. For static methods, pass null to this parameter. |
||
220 | * @param mixed $parameter Zero or more parameters to be passed to the method. It accepts a variable number of parameters which are passed to the method. |
||
221 | * |
||
222 | * @throws \ReflectionException Always... Can't be implemented. |
||
223 | * |
||
224 | * @return mixed The method result. |
||
225 | */ |
||
226 | public function invoke($object) |
||
230 | |||
231 | /** |
||
232 | * Invokes the reflected method and pass its arguments as array. |
||
233 | * |
||
234 | * @param object $object The object to invoke the method on. For static methods, pass null to this parameter. |
||
235 | * @param array $args The parameters to be passed to the function, as an array. |
||
236 | * |
||
237 | * @throws \ReflectionException Always... Can't be implemented. |
||
238 | * |
||
239 | * @return mixed The method result. |
||
240 | */ |
||
241 | public function invokeArgs($object, array $args) |
||
245 | |||
246 | 963 | public function addParameter(ReflectionParameter $parameter) |
|
253 | |||
254 | 450 | public function addStaticVariable($name, $value) |
|
260 | |||
261 | 1062 | public function setReturnsByRef($returnsByRef) |
|
267 | |||
268 | 450 | public function setGenerator($isGenerator) |
|
274 | } |
||
275 |