| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getMethodRequiredArgCount($class, string $method): int |
||
| 32 | { |
||
| 33 | $instance = new \ReflectionMethod($class, $method); |
||
| 34 | $count = 0; |
||
| 35 | // calculate method defined arguments count |
||
| 36 | foreach ($instance->getParameters() as $arg) { |
||
| 37 | if (!$arg->isOptional()) { |
||
| 38 | $count++; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return $count; |
||
| 43 | } |
||
| 45 |