Skip to content

Commit e303360

Browse files
committed
Fix
1 parent a5eb5b5 commit e303360

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,8 @@ private function resolveType(Expr $node): Type
10621062
}
10631063

10641064
if (count($accessoryTypes) > 0) {
1065-
return new IntersectionType([new StringType(), ...$accessoryTypes]);
1065+
$accessoryTypes[] = new StringType();
1066+
return new IntersectionType($accessoryTypes);
10661067
}
10671068

10681069
return new StringType();

src/Type/Php/ImplodeFunctionReturnTypeExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public function getTypeFromFunctionCall(
4141
}
4242

4343
if (count($accessoryTypes) > 0) {
44-
return new IntersectionType([new StringType(), ...$accessoryTypes]);
44+
$accessoryTypes[] = new StringType();
45+
return new IntersectionType($accessoryTypes);
4546
}
4647

4748
return new StringType();
@@ -66,7 +67,8 @@ public function getTypeFromFunctionCall(
6667
}
6768

6869
if (count($accessoryTypes) > 0) {
69-
return new IntersectionType([new StringType(), ...$accessoryTypes]);
70+
$accessoryTypes[] = new StringType();
71+
return new IntersectionType($accessoryTypes);
7072
}
7173

7274
return new StringType();

src/Type/Php/StrPadFunctionReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function getTypeFromFunctionCall(
5151
}
5252

5353
if (count($accessoryTypes) > 0) {
54-
return new IntersectionType([new StringType(), ...$accessoryTypes]);
54+
$accessoryTypes[] = new StringType();
55+
return new IntersectionType($accessoryTypes);
5556
}
5657

5758
return new StringType();

src/Type/Php/StrRepeatFunctionReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function getTypeFromFunctionCall(
5252
}
5353

5454
if (count($accessoryTypes) > 0) {
55-
return new IntersectionType([new StringType(), ...$accessoryTypes]);
55+
$accessoryTypes[] = new StringType();
56+
return new IntersectionType($accessoryTypes);
5657
}
5758

5859
return new StringType();

0 commit comments

Comments
 (0)