1 | <?php |
||
21 | class ReflectionFunction extends BaseReflectionFunction |
||
22 | { |
||
23 | use ReflectionFunctionLikeTrait, InternalPropertiesEmulationTrait; |
||
24 | |||
25 | /** |
||
26 | * Initializes reflection instance for given AST-node |
||
27 | * |
||
28 | * @param string|\Closure $functionName The name of the function to reflect or a closure. |
||
29 | * @param Function_|null $functionNode Function node AST |
||
30 | */ |
||
31 | 17 | public function __construct($functionName, Function_ $functionNode) |
|
32 | { |
||
33 | 17 | $namespaceParts = explode('\\', $functionName); |
|
34 | // Remove the last one part with function name |
||
35 | 17 | array_pop($namespaceParts); |
|
36 | 17 | $this->namespaceName = join('\\', $namespaceParts); |
|
37 | |||
38 | 17 | $this->functionLikeNode = $functionNode; |
|
39 | 17 | unset($this->name); |
|
40 | 17 | } |
|
41 | |||
42 | /** |
||
43 | * Emulating original behaviour of reflection |
||
44 | */ |
||
45 | 1 | public function ___debugInfo() |
|
55 | |||
56 | /** |
||
57 | * Returns an AST-node for function |
||
58 | * |
||
59 | * @return Function_ |
||
60 | */ |
||
61 | public function getNode() |
||
65 | |||
66 | /** |
||
67 | * {@inheritDoc} |
||
68 | */ |
||
69 | 1 | public function getClosure() |
|
75 | |||
76 | /** |
||
77 | * {@inheritDoc} |
||
78 | */ |
||
79 | 1 | public function invoke($args = null) |
|
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | 1 | public function invokeArgs(array $args) |
|
95 | |||
96 | /** |
||
97 | * Checks if function is disabled |
||
98 | * |
||
99 | * Only internal functions can be disabled using disable_functions directive. |
||
100 | * User-defined functions are unaffected. |
||
101 | */ |
||
102 | 1 | public function isDisabled() |
|
106 | |||
107 | /** |
||
108 | * Returns textual representation of function |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | 1 | public function __toString() |
|
130 | |||
131 | |||
132 | /** |
||
133 | * Implementation of internal reflection initialization |
||
134 | * |
||
135 | * @return void |
||
136 | */ |
||
137 | 4 | protected function __initialize() |
|
141 | } |
||
142 |