File tree Expand file tree Collapse file tree
rules/TypeDeclaration/NodeAnalyzer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212use PhpParser \Node \Identifier ;
1313use PhpParser \Node \VariadicPlaceholder ;
1414use PHPStan \Reflection \ReflectionProvider ;
15- use PHPStan \Type \Accessory \AccessoryArrayListType ;
1615use PHPStan \Type \ArrayType ;
1716use PHPStan \Type \Constant \ConstantArrayType ;
18- use PHPStan \Type \IntersectionType ;
1917use PHPStan \Type \MixedType ;
2018use PHPStan \Type \NeverType ;
2119use PHPStan \Type \ObjectType ;
@@ -234,26 +232,4 @@ private function isArrayMixedMixedType(Type $type): bool
234232
235233 return $ type ->getKeyType () instanceof MixedType || $ type ->getKeyType () instanceof NeverType;
236234 }
237-
238- private function cleanArrayIntersectionType (Type $ type ): Type
239- {
240- if (! $ type instanceof IntersectionType) {
241- return $ type ;
242- }
243-
244- $ cleanTypes = [];
245- foreach ($ type ->getTypes () as $ intersectionType ) {
246- if ($ intersectionType instanceof AccessoryArrayListType) {
247- continue ;
248- }
249-
250- $ cleanTypes [] = $ intersectionType ;
251- }
252-
253- if (count ($ cleanTypes ) === 1 ) {
254- return $ cleanTypes [0 ];
255- }
256-
257- return new IntersectionType ($ cleanTypes );
258- }
259235}
You can’t perform that action at this time.
0 commit comments