| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function getMethodRequiredArgCount($class, string $method): int |
||
| 39 | { |
||
| 40 | $instance = new \ReflectionMethod($class, $method); |
||
| 41 | $count = 0; |
||
| 42 | // calculate method defined arguments count |
||
| 43 | foreach ($instance->getParameters() as $arg) { |
||
| 44 | if (!$arg->isOptional()) { |
||
| 45 | $count++; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | return $count; |
||
| 50 | } |
||
| 52 |