@@ -5610,17 +5610,9 @@ private function processAssignVar(
5610
5610
$ originalVar = $ var ;
5611
5611
$ assignedPropertyExpr = $ assignedExpr ;
5612
5612
while ($ var instanceof ArrayDimFetch) {
5613
- if (
5614
- $ var ->var instanceof PropertyFetch
5615
- || $ var ->var instanceof StaticPropertyFetch
5616
- ) {
5617
- if (((new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ scope ->getType ($ var ->var ))->yes ())) {
5618
- $ varForSetOffsetValue = $ var ->var ;
5619
- } else {
5620
- $ varForSetOffsetValue = new OriginalPropertyTypeExpr ($ var ->var );
5621
- }
5622
- } else {
5623
- $ varForSetOffsetValue = $ var ->var ;
5613
+ $ varForSetOffsetValue = $ var ->var ;
5614
+ if ($ varForSetOffsetValue instanceof PropertyFetch || $ varForSetOffsetValue instanceof StaticPropertyFetch) {
5615
+ $ varForSetOffsetValue = new OriginalPropertyTypeExpr ($ varForSetOffsetValue );
5624
5616
}
5625
5617
5626
5618
if (
@@ -6034,17 +6026,9 @@ static function (): void {
6034
6026
$ dimFetchStack = [];
6035
6027
$ assignedPropertyExpr = $ assignedExpr ;
6036
6028
while ($ var instanceof ExistingArrayDimFetch) {
6037
- if (
6038
- $ var ->getVar () instanceof PropertyFetch
6039
- || $ var ->getVar () instanceof StaticPropertyFetch
6040
- ) {
6041
- if (((new ObjectType (ArrayAccess::class))->isSuperTypeOf ($ scope ->getType ($ var ->getVar ()))->yes ())) {
6042
- $ varForSetOffsetValue = $ var ->getVar ();
6043
- } else {
6044
- $ varForSetOffsetValue = new OriginalPropertyTypeExpr ($ var ->getVar ());
6045
- }
6046
- } else {
6047
- $ varForSetOffsetValue = $ var ->getVar ();
6029
+ $ varForSetOffsetValue = $ var ->getVar ();
6030
+ if ($ varForSetOffsetValue instanceof PropertyFetch || $ varForSetOffsetValue instanceof StaticPropertyFetch) {
6031
+ $ varForSetOffsetValue = new OriginalPropertyTypeExpr ($ varForSetOffsetValue );
6048
6032
}
6049
6033
$ assignedPropertyExpr = new SetExistingOffsetValueTypeExpr (
6050
6034
$ varForSetOffsetValue ,
0 commit comments