| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 15 | 8 | public function pass(FuncCall $funcCall, Context $context) |
|
| 16 | { |
||
| 17 | 8 | $functionName = $this->resolveFunctionName($funcCall, $context); |
|
| 18 | 8 | if ($functionName === "func_get_args") { |
|
| 19 | 1 | $scopePointer = $context->scopePointer->getObject(); |
|
| 20 | |||
| 21 | 1 | if ($scopePointer instanceof ClassMethod || $scopePointer instanceof FunctionDefinition) { |
|
| 22 | 1 | if (count($scopePointer->getParams()) === 0) { |
|
| 23 | 1 | $context->notice( |
|
| 24 | 1 | 'fcall.argumentunpacking', |
|
| 25 | 1 | sprintf('Please use argument unpacking (...) instead of func_get_args().'), |
|
| 26 | $funcCall |
||
| 27 | 1 | ); |
|
| 28 | 1 | return; |
|
| 29 | } |
||
| 30 | 1 | } |
|
| 31 | 1 | } |
|
| 32 | 8 | } |
|
| 33 | } |
||
| 34 |