Skip to content

Commit 399e22d

Browse files
committed
fixup! fixup! Add stringable access check to ClassConstantRule
1 parent b0539eb commit 399e22d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Rules/Classes/ClassConstantRule.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ public function processNode(Node $node, Scope $scope): array
7676
static fn (Type $type) => $type->isString()->yes(),
7777
);
7878

79-
$type = $nameTypeResult->getType();
80-
81-
if (!$type->isString()->yes()) {
79+
$nameType = $nameTypeResult->getType();
80+
if (!$nameType instanceof ErrorType && !$nameType->isString()->yes()) {
8281
$className = $node->class instanceof Name
8382
? $scope->resolveName($node->class)
8483
: $scope->getType($node->class)->describe(VerbosityLevel::typeOnly());

0 commit comments

Comments
 (0)