File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -3525,22 +3525,16 @@ public function restoreThis(self $restoreThisScope): self
35253525 $ nativeExpressionTypes = $ this ->nativeExpressionTypes ;
35263526
35273527 if ($ restoreThisScope ->isInClass ()) {
3528- $ nodeFinder = new NodeFinder ();
3529- $ cb = static fn ($ expr ) => $ expr instanceof Variable && $ expr ->name === 'this ' ;
35303528 foreach ($ restoreThisScope ->expressionTypes as $ exprString => $ expressionTypeHolder ) {
3531- $ expr = $ expressionTypeHolder ->getExpr ();
3532- $ thisExpr = $ nodeFinder ->findFirst ([$ expr ], $ cb );
3533- if ($ thisExpr === null ) {
3529+ if (!str_starts_with ($ exprString , '$this ' )) {
35343530 continue ;
35353531 }
35363532
35373533 $ expressionTypes [$ exprString ] = $ expressionTypeHolder ;
35383534 }
35393535
35403536 foreach ($ restoreThisScope ->nativeExpressionTypes as $ exprString => $ expressionTypeHolder ) {
3541- $ expr = $ expressionTypeHolder ->getExpr ();
3542- $ thisExpr = $ nodeFinder ->findFirst ([$ expr ], $ cb );
3543- if ($ thisExpr === null ) {
3537+ if (!str_starts_with ($ exprString , '$this ' )) {
35443538 continue ;
35453539 }
35463540
You can’t perform that action at this time.
0 commit comments