File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
rules/DowngradePhp81/Rector/Array_ Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 1111use PHPStan \Type \ArrayType ;
1212use PHPStan \Type \Constant \ConstantArrayType ;
1313use PHPStan \Type \IntegerType ;
14- use PHPStan \Type \IntersectionType ;
15- use PHPStan \Type \UnionType ;
1614use Rector \DowngradePhp81 \NodeAnalyzer \ArraySpreadAnalyzer ;
1715use Rector \DowngradePhp81 \NodeFactory \ArrayMergeFromArraySpreadFactory ;
1816use Rector \PHPStan \ScopeFetcher ;
@@ -92,19 +90,10 @@ private function shouldSkipArray(Array_ $array): bool
9290 }
9391
9492 $ type = $ this ->nodeTypeResolver ->getType ($ item ->value );
95- if (! $ type-> isArray ()-> yes () ) {
93+ if (! $ type instanceof ArrayType && ! $ type instanceof ConstantArrayType ) {
9694 continue ;
9795 }
9896
99- if ($ type instanceof UnionType) {
100- continue ;
101- }
102-
103- if ($ type instanceof IntersectionType) {
104- continue ;
105- }
106-
107- /** @var ArrayType|ConstantArrayType $type */
10897 $ keyType = $ type ->getKeyType ();
10998 if ($ keyType instanceof IntegerType) {
11099 return true ;
You can’t perform that action at this time.
0 commit comments