Skip to content
Permalink
Browse files

Fix #1791 - complain about missing class constants

  • Loading branch information...
muglug committed Jun 15, 2019
1 parent afc2f18 commit 06e913e37b76d5ea82c53e6bada6b7e6cff0ee1e
@@ -216,7 +216,7 @@ public static function analyzeClassConst(
$class_visibility
);
if (!isset($class_constants[$stmt->name->name]) && $first_part_lc !== 'static') {
if (!isset($class_constants[$stmt->name->name])) {
$all_class_constants = [];
if ($fq_class_name !== $context->self) {
@@ -487,6 +487,17 @@ public function getC(): string {
}',
'error_message' => 'UndefinedConstant',
],
'preventStaticClassConstWithoutRef' => [
'<?php
class Foo {
public const CONST = 1;
public function x() : void {
echo static::CON;
}
}',
'error_message' => 'UndefinedConstant',
],
];
}
}

0 comments on commit 06e913e

Please sign in to comment.
You can’t perform that action at this time.