| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function visitPhpFunctionCall(FuncCall $funcCall, Context $context) |
||
| 15 | { |
||
| 16 | $name = false; |
||
| 17 | |||
| 18 | if ($funcCall->name instanceof Name && !$funcCall->name->isFullyQualified()) { |
||
| 19 | $name = $funcCall->name->getFirst(); |
||
| 20 | } |
||
| 21 | |||
| 22 | if ($name && $name == 'array') { |
||
|
|
|||
| 23 | $context->notice( |
||
| 24 | 'array.short-syntax', |
||
| 25 | 'Please use [] (short syntax) for array definition.', |
||
| 26 | $funcCall |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | } |
||
| 31 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: