| Conditions | 5 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5.0187 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | 5 | public function pass(FuncCall $funcCall, Context $context) |
|
| 27 | { |
||
| 28 | 5 | $functionName = $this->resolveFunctionName($funcCall, $context); |
|
| 29 | 5 | if ($functionName && isset($this->map[$functionName])) { |
|
| 30 | /** |
||
| 31 | * Exclusion via intval with 2 args intval($number, int $base = 10); |
||
| 32 | */ |
||
| 33 | 1 | if ($functionName == 'intval' && count($funcCall->args) > 1) { |
|
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | 1 | $context->notice( |
|
| 38 | 1 | 'fcall.cast', |
|
| 39 | 1 | sprintf('Please use (%s) cast instead of function call.', $this->map[$functionName]), |
|
| 40 | $funcCall |
||
| 41 | 1 | ); |
|
| 42 | 1 | } |
|
| 43 | 5 | } |
|
| 44 | } |
||
| 45 |