Exemplo n.º 1
0
 /**
  * @param Stmt $stmt
  * @param Context $context
  * @return bool
  */
 public function pass(Stmt $stmt, Context $context)
 {
     if ($stmt instanceof Stmt\ClassMethod && $stmt->isAbstract()) {
         // abstract classes are ok
         return false;
     }
     if ($stmt instanceof Stmt\Switch_) {
         $counting = $stmt->cases;
     } else {
         $counting = $stmt->stmts;
     }
     if (count($counting) === 0) {
         $context->notice('missing_body', 'Missing Body', $stmt);
         return true;
     }
     return false;
 }