| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 49 | public function pass(Expr $expr, Context $context) |
|
| 19 | { |
||
| 20 | 49 | $compiler = $context->getExpressionCompiler(); |
|
| 21 | 49 | $left = $compiler->compile($expr->left); |
|
|
|
|||
| 22 | 49 | $right = $compiler->compile($expr->right); |
|
| 23 | |||
| 24 | 49 | if ($left->isArray() || $right->isArray()) { |
|
| 25 | 1 | $context->notice( |
|
| 26 | 1 | 'compare_with_array', |
|
| 27 | 1 | "You are comparing an array. Did you want to use count()?", |
|
| 28 | $expr |
||
| 29 | 1 | ); |
|
| 30 | |||
| 31 | 1 | return true; |
|
| 32 | } |
||
| 33 | |||
| 34 | 48 | return false; |
|
| 35 | } |
||
| 36 | |||
| 50 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.