Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 27, 2021
1 parent a5eb5b5 commit e303360
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Analyser/MutatingScope.php
Expand Up @@ -1062,7 +1062,8 @@ private function resolveType(Expr $node): Type
}

if (count($accessoryTypes) > 0) {
return new IntersectionType([new StringType(), ...$accessoryTypes]);
$accessoryTypes[] = new StringType();
return new IntersectionType($accessoryTypes);
}

return new StringType();
Expand Down
6 changes: 4 additions & 2 deletions src/Type/Php/ImplodeFunctionReturnTypeExtension.php
Expand Up @@ -41,7 +41,8 @@ public function getTypeFromFunctionCall(
}

if (count($accessoryTypes) > 0) {
return new IntersectionType([new StringType(), ...$accessoryTypes]);
$accessoryTypes[] = new StringType();
return new IntersectionType($accessoryTypes);
}

return new StringType();
Expand All @@ -66,7 +67,8 @@ public function getTypeFromFunctionCall(
}

if (count($accessoryTypes) > 0) {
return new IntersectionType([new StringType(), ...$accessoryTypes]);
$accessoryTypes[] = new StringType();
return new IntersectionType($accessoryTypes);
}

return new StringType();
Expand Down
3 changes: 2 additions & 1 deletion src/Type/Php/StrPadFunctionReturnTypeExtension.php
Expand Up @@ -51,7 +51,8 @@ public function getTypeFromFunctionCall(
}

if (count($accessoryTypes) > 0) {
return new IntersectionType([new StringType(), ...$accessoryTypes]);
$accessoryTypes[] = new StringType();
return new IntersectionType($accessoryTypes);
}

return new StringType();
Expand Down
3 changes: 2 additions & 1 deletion src/Type/Php/StrRepeatFunctionReturnTypeExtension.php
Expand Up @@ -52,7 +52,8 @@ public function getTypeFromFunctionCall(
}

if (count($accessoryTypes) > 0) {
return new IntersectionType([new StringType(), ...$accessoryTypes]);
$accessoryTypes[] = new StringType();
return new IntersectionType($accessoryTypes);
}

return new StringType();
Expand Down

0 comments on commit e303360

Please sign in to comment.