Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
35 | 2 | private function getStateClass(callable $update): string |
|
36 | { |
||
37 | 2 | $reflection = new \ReflectionFunction($update); |
|
38 | |||
39 | 2 | if ($reflection->getNumberOfParameters() <= 0) { |
|
40 | 1 | throw new \Exception("Updater callback must have one type-hinted parameter"); |
|
41 | } |
||
42 | |||
43 | 1 | return $reflection->getParameters()[0]->getClass()->name; |
|
44 | } |
||
45 | } |