Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
6 | function reflectionFunction(callable $f): \ReflectionFunctionAbstract |
||
7 | { |
||
8 | if (is_object($f)) { |
||
9 | return (new \ReflectionObject($f))->getMethod('__invoke'); |
||
10 | } |
||
11 | |||
12 | if (isClassStaticMethodCall($f)) { |
||
13 | return (new \ReflectionClass($f[0]))->getMethod($f[1]); |
||
14 | } |
||
15 | |||
16 | if (isObjectMethodCall($f)) { |
||
17 | return (new \ReflectionObject($f[0]))->getMethod($f[1]); |
||
18 | } |
||
19 | |||
20 | return new \ReflectionFunction($f); |
||
21 | } |
||
38 |