diff --git a/specs/const/const-declaration.php b/specs/const/const-declaration.php index 08736856..aebf26d6 100644 --- a/specs/const/const-declaration.php +++ b/specs/const/const-declaration.php @@ -471,4 +471,50 @@ function isAnotherNewToken(int $token) : bool PHP, ], + + 'Define check of a global class constant' => <<<'PHP' + <<<'PHP' + value)) - || 1 !== native_preg_match(self::CLASS_LIKE_PATTERN, $string->value) + || ( + 1 !== native_preg_match(self::CLASS_LIKE_PATTERN, $string->value) + && 1 !== native_preg_match(self::CONSTANT_FETCH_PATTERN, $string->value) + ) ) { return $string; }