1 | <?php |
||
13 | class MissingBreakStatement implements Pass\AnalyzerPassInterface |
||
14 | { |
||
15 | use DefaultMetadataPassTrait; |
||
16 | |||
17 | const DESCRIPTION = 'Checks for a missing break or return statement in switch cases. Can ignore empty cases and the last case.'; |
||
18 | |||
19 | /** |
||
20 | * @param Stmt\Switch_ $switchStmt |
||
21 | * @param Context $context |
||
22 | * @return bool |
||
23 | */ |
||
24 | public function pass(Stmt\Switch_ $switchStmt, Context $context) |
||
42 | |||
43 | /** |
||
44 | * @return array |
||
45 | */ |
||
46 | public function getRegister() |
||
52 | |||
53 | /** |
||
54 | * @param Stmt\Case_ $case |
||
55 | * @param Context $context |
||
56 | * @return bool |
||
57 | */ |
||
58 | private function checkCaseStatement(Stmt\Case_ $case, Context $context) |
||
94 | } |
||
95 |