Skip to content

Commit ab3256e

Browse files
phpstan-botclaude
andcommitted
Rename isEffectivelyReadOnly to hasRestrictedWriteAccess for clarity
Address review feedback: the previous name was unclear about what it checked. The new name better communicates that the method detects properties with restricted write access (asymmetric visibility or get-only hooks). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 46927a8 commit ab3256e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Rules/Generics/PropertyVarianceRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function processNode(Node $node, Scope $scope): array
4545
return [];
4646
}
4747

48-
$variance = $node->isReadOnly() || $node->isReadOnlyByPhpDoc() || $this->isEffectivelyReadOnly($node)
48+
$variance = $node->isReadOnly() || $node->isReadOnlyByPhpDoc() || $this->hasRestrictedWriteAccess($node)
4949
? TemplateTypeVariance::createCovariant()
5050
: TemplateTypeVariance::createInvariant();
5151

@@ -56,7 +56,7 @@ public function processNode(Node $node, Scope $scope): array
5656
);
5757
}
5858

59-
private function isEffectivelyReadOnly(ClassPropertyNode $node): bool
59+
private function hasRestrictedWriteAccess(ClassPropertyNode $node): bool
6060
{
6161
if ($node->isPrivateSet() || $node->isProtectedSet()) {
6262
return true;

0 commit comments

Comments
 (0)