File tree Expand file tree Collapse file tree
src/NodeTypeResolver/PHPStan/Type Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616use PHPStan \Type \ObjectType ;
1717use PHPStan \Type \StringType ;
1818use PHPStan \Type \Type ;
19+ use PHPStan \Type \TypeUtils ;
1920use PHPStan \Type \UnionType ;
2021use Rector \NodeTypeResolver \PHPStan \ObjectWithoutClassTypeWithParentTypes ;
2122use Rector \NodeTypeResolver \PHPStan \TypeHasher ;
@@ -126,7 +127,7 @@ private function unwrapUnionedTypes(array $types): array
126127 // unwrap union types
127128 $ unwrappedTypes = [];
128129 foreach ($ types as $ type ) {
129- $ flattenTypes = TypeFlattener :: flatten ($ type );
130+ $ flattenTypes = TypeUtils :: flattenTypes ($ type );
130131
131132 foreach ($ flattenTypes as $ flattenType ) {
132133 if ($ flattenType instanceof ConstantArrayType) {
@@ -201,8 +202,8 @@ private function unwrapConstantArrayTypes(ConstantArrayType $constantArrayType):
201202 {
202203 $ unwrappedTypes = [];
203204
204- $ flattenKeyTypes = TypeFlattener :: flatten ($ constantArrayType ->getIterableKeyType ());
205- $ flattenItemTypes = TypeFlattener :: flatten ($ constantArrayType ->getIterableValueType ());
205+ $ flattenKeyTypes = TypeUtils :: flattenTypes ($ constantArrayType ->getIterableKeyType ());
206+ $ flattenItemTypes = TypeUtils :: flattenTypes ($ constantArrayType ->getIterableValueType ());
206207
207208 foreach ($ flattenItemTypes as $ position => $ nestedFlattenItemType ) {
208209 $ nestedFlattenKeyType = $ flattenKeyTypes [$ position ] ?? null ;
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments