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