PHPSA\Analyzer\Pass\Statement\GotoUsage::pass PHP Метод

pass() публичный Метод

public pass ( PhpParser\Node\Stmt $stmt, Context $context ) : boolean
$stmt PhpParser\Node\Stmt
$context PHPSA\Context
Результат boolean
    public function pass(Stmt $stmt, Context $context)
    {
        if ($stmt instanceof Label) {
            $context->notice('goto_usage', 'Do not use labels', $stmt);
            return true;
        } elseif ($stmt instanceof Goto_) {
            $context->notice('goto_usage', 'Do not use goto statements', $stmt);
            return true;
        }
        return false;
    }