Skip to content
Prev Previous commit
Next Next commit
Change isFinal return type
  • Loading branch information
lpd-au committed May 14, 2025
commit d8d32336400675b8e683f1c17c7f9e28b4b51359
4 changes: 2 additions & 2 deletions src/Reflection/Php/PhpPropertyReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public function isReadOnlyByPhpDoc(): bool
return $this->isReadOnlyByPhpDoc;
}

public function isFinal(): bool
public function isFinal(): TrinaryLogic
{
return $this->isFinal;
return TrinaryLogic::createFromBoolean($this->isFinal);
}

public function getReadableType(): Type
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/Properties/OverridingPropertyRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function processNode(Node $node, Scope $scope): array
))->identifier('property.parentPropertyFinal')
->nonIgnorable()
->build();
} elseif ($prototype->isFinal()) {
} elseif ($prototype->isFinal()->yes()) {
$errors[] = RuleErrorBuilder::message(sprintf(
'Property %s::$%s overrides @final property %s::$%s.',
$classReflection->getDisplayName(),
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/Variables/UnsetRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function processNode(Node $node, Scope $scope): array
} elseif ($this->phpVersion->supportsPropertyHooks()) {
if (
!$propertyReflection->isPrivate()
&& !$propertyReflection->isFinal()
&& !$propertyReflection->isFinal()->yes()
&& !$propertyReflection->getDeclaringClass()->isFinal()
) {
$errors[] = RuleErrorBuilder::message(
Expand Down