| 1 | <?php |
||
| 12 | class MissingBreakStatement implements Pass\AnalyzerPassInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @param Stmt\Switch_ $switchStmt |
||
| 16 | * @param Context $context |
||
| 17 | * @return bool |
||
| 18 | */ |
||
| 19 | 2 | public function pass(Stmt\Switch_ $switchStmt, Context $context) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return array |
||
| 40 | */ |
||
| 41 | 1 | public function getRegister() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @param Stmt\Case_ $case |
||
| 50 | * @param Context $context |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | 2 | private function checkCaseStatement(Stmt\Case_ $case, Context $context) |
|
| 87 | } |
||
| 88 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.