Skip to content

Commit 5cddc72

Browse files
phpstan-botclaude
andcommitted
Rename generalizeConstantType back to generalizeDynamicConstantType
The method is only called in contexts where the constant is in dynamicConstantNames, so the "Dynamic" qualifier is appropriate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f79e4b8 commit 5cddc72

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Analyser/ConstantResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public function resolveConstantType(string $constantName, Type $constantType): T
426426
return $constantType;
427427
}
428428
if (in_array($constantName, $this->dynamicConstantNames, true)) {
429-
return $this->generalizeConstantType($constantType);
429+
return $this->generalizeDynamicConstantType($constantType);
430430
}
431431
}
432432

@@ -461,14 +461,14 @@ public function resolveClassConstantType(string $className, string $constantName
461461
}
462462

463463
if ($constantType->isConstantValue()->yes()) {
464-
return $this->generalizeConstantType($constantType);
464+
return $this->generalizeDynamicConstantType($constantType);
465465
}
466466
}
467467

468468
return $constantType;
469469
}
470470

471-
private function generalizeConstantType(Type $constantType): Type
471+
private function generalizeDynamicConstantType(Type $constantType): Type
472472
{
473473
$generalized = $constantType->generalize(GeneralizePrecision::lessSpecific());
474474
if ($generalized->equals(new ConstantArrayType([], []))) {

0 commit comments

Comments
 (0)