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