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

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

public pass ( ClassConst $stmt, Context $context ) : boolean
$stmt PhpParser\Node\Stmt\ClassConst
$context PHPSA\Context
Результат boolean
    public function pass(ClassConst $stmt, Context $context)
    {
        $result = false;
        foreach ($stmt->consts as $const) {
            if ($const->name != strtoupper($const->name)) {
                $context->notice('constant.naming', 'Constant names should be all uppercase.', $stmt);
                $result = true;
            }
        }
        return $result;
    }
ConstantNaming