File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -144,16 +144,14 @@ public static function toReflection($callable): \ReflectionFunctionAbstract
144144 $ callable = self ::unwrap ($ callable );
145145 }
146146
147- $ class = class_exists (Nette \Reflection \Method::class) ? Nette \Reflection \Method::class : 'ReflectionMethod ' ;
148147 if (is_string ($ callable ) && strpos ($ callable , ':: ' )) {
149- return new $ class ($ callable );
148+ return new \ ReflectionMethod ($ callable );
150149 } elseif (is_array ($ callable )) {
151- return new $ class ($ callable [0 ], $ callable [1 ]);
150+ return new \ ReflectionMethod ($ callable [0 ], $ callable [1 ]);
152151 } elseif (is_object ($ callable ) && !$ callable instanceof \Closure) {
153- return new $ class ($ callable , '__invoke ' );
152+ return new \ ReflectionMethod ($ callable , '__invoke ' );
154153 } else {
155- $ class = class_exists (Nette \Reflection \GlobalFunction::class) ? Nette \Reflection \GlobalFunction::class : 'ReflectionFunction ' ;
156- return new $ class ($ callable );
154+ return new \ReflectionFunction ($ callable );
157155 }
158156 }
159157
You can’t perform that action at this time.
0 commit comments