Skip to content

Commit 33171cd

Browse files
phpstan-botclaude
andcommitted
Remove unused $hasNonExistentMethod variable in findTypeAndMethodNames()
Make the by-reference parameter optional with a default value so findTypeAndMethodNames() doesn't need to instantiate a variable it never reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a936524 commit 33171cd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,11 @@ public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope)
545545
/** @return ConstantArrayTypeAndMethod[] */
546546
public function findTypeAndMethodNames(): array
547547
{
548-
$hasNonExistentMethod = false;
549-
return $this->doFindTypeAndMethodNames($hasNonExistentMethod);
548+
return $this->doFindTypeAndMethodNames();
550549
}
551550

552551
/** @return ConstantArrayTypeAndMethod[] */
553-
private function doFindTypeAndMethodNames(bool &$hasNonExistentMethod): array
552+
private function doFindTypeAndMethodNames(bool &$hasNonExistentMethod = false): array
554553
{
555554
if (count($this->keyTypes) !== 2) {
556555
return [];

0 commit comments

Comments
 (0)