File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3088,7 +3088,7 @@ protected function getTypeFromArrayDimFetch(
30883088 throw new ShouldNotHappenException ();
30893089 }
30903090
3091- if ((new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ offsetAccessibleType )->yes ()) {
3091+ if (! $ offsetAccessibleType -> isArray ()-> yes () && (new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ offsetAccessibleType )->yes ()) {
30923092 return $ this ->getType (
30933093 new MethodCall (
30943094 $ arrayDimFetch ->var ,
Original file line number Diff line number Diff line change @@ -3306,7 +3306,7 @@ private function processAssignVar(
33063306 $ valueToWrite = $ offsetValueType ->setOffsetValueType ($ offsetType , $ valueToWrite , $ i === 0 );
33073307 }
33083308
3309- if (!(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->yes ()) {
3309+ if ($ varType -> isArray ()-> yes () || !(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->yes ()) {
33103310 if ($ var instanceof Variable && is_string ($ var ->name )) {
33113311 $ scope = $ scope ->assignVariable ($ var ->name , $ valueToWrite );
33123312 } else {
@@ -3334,7 +3334,7 @@ private function processAssignVar(
33343334 }
33353335 }
33363336
3337- if (!(new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->no ()) {
3337+ if (!$ varType -> isArray ()-> yes () && ! (new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ varType )->no ()) {
33383338 $ throwPoints = array_merge ($ throwPoints , $ this ->processExprNode (
33393339 new MethodCall ($ var , 'offsetSet ' ),
33403340 $ scope ,
You can’t perform that action at this time.
0 commit comments