Skip to content

Commit b2dcde5

Browse files
authored
Revert "[NodeTypeResolver] Apply logic Mixed inside Union check on TypeFactor…" (#7347)
This reverts commit dd60a7c.
1 parent dd60a7c commit b2dcde5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/NodeTypeResolver/PHPStan/Type/TypeFactory.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ public function uniquateTypes(array $types, bool $keepConstant = false): array
6464
$hasFalse = false;
6565
$hasTrue = false;
6666
foreach ($types as $type) {
67-
// mixed only allowed to be standalone
6867
if ($type instanceof MixedType) {
69-
/** @var array<TType> */
70-
return [new MixedType()];
68+
$type = new MixedType();
7169
}
7270

7371
$type = $this->normalizeObjectType($totalTypes, $type);
@@ -170,6 +168,12 @@ private function createUnionOrSingleType(array $types): Type
170168
return $types[0];
171169
}
172170

171+
foreach ($types as $type) {
172+
if ($type instanceof MixedType) {
173+
return new MixedType();
174+
}
175+
}
176+
173177
return new UnionType($types);
174178
}
175179

0 commit comments

Comments
 (0)