Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 15, 2024
1 parent c042a0f commit 6992147
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private function processAddArrayReturnType(
$node->returnType = new Identifier('array');

// add more precise array type if suitable
if ($returnType->isArray()->yes() && $this->shouldAddReturnArrayDocType($returnType)) {
if ($this->shouldAddReturnArrayDocType($returnType)) {
$this->changeReturnType($node, $returnType);
}

Expand All @@ -174,7 +174,7 @@ private function shouldSkip(ClassMethod|Function_|Closure $node, Scope $scope):
);
}

private function changeReturnType(ClassMethod|Function_|Closure $node, ArrayType|\PHPStan\Type\Constant\ConstantArrayType $arrayType): void
private function changeReturnType(ClassMethod|Function_|Closure $node, ArrayType|ConstantArrayType $arrayType): void
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);

Expand Down Expand Up @@ -263,7 +263,7 @@ private function matchArrayAssignedVariable(array $stmts): array
return $variables;
}

private function shouldAddReturnArrayDocType(ArrayType|\PHPStan\Type\Constant\ConstantArrayType $arrayType): bool
private function shouldAddReturnArrayDocType(ArrayType|ConstantArrayType $arrayType): bool
{
if ($arrayType instanceof ConstantArrayType) {
if ($arrayType->getItemType() instanceof NeverType) {
Expand Down

0 comments on commit 6992147

Please sign in to comment.