Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3.0067 |
Changes | 0 |
1 | <?php |
||
21 | 1 | public function pass(Expr\BinaryOp $expr, Context $context) |
|
22 | { |
||
23 | 1 | $compiler = $context->getExpressionCompiler(); |
|
24 | 1 | $left = $compiler->compile($expr->left); |
|
25 | 1 | $right = $compiler->compile($expr->right); |
|
26 | |||
27 | 1 | if ($left->isArray() || $right->isArray()) { |
|
28 | 1 | $context->notice( |
|
29 | 1 | 'compare_with_array', |
|
30 | 1 | "You are comparing an array. Did you want to use count()?", |
|
31 | $expr |
||
32 | 1 | ); |
|
33 | |||
34 | 1 | return true; |
|
35 | } |
||
36 | |||
37 | return false; |
||
38 | } |
||
39 | |||
53 |