Skip to content

[Scope] Handle Scope refreshing on Attribute on print string with NOWDOC#7194

Merged
samsonasik merged 4 commits intomainfrom
handle-new-attribute
Aug 29, 2025
Merged

[Scope] Handle Scope refreshing on Attribute on print string with NOWDOC#7194
samsonasik merged 4 commits intomainfrom
handle-new-attribute

Conversation

@samsonasik
Copy link
Member

It currently cause invalid printing:

1) Rector\Tests\Issues\PrintStringNowDocUnderAttributeTarget\PrintStringNowDocUnderAttributeTargetTest::test with data set #0 ('/Users/samsonasik/www/rector-...hp.inc')
Failed on fixture file "fixture.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 final readonly class Fixture
 {
     public function __construct(
-        #[\SomeNewAttribute(
-            <<<'SOME_VALUE_TEXT'
-                execute ($id: ID!) {
-                    run(id: $id) {
-                        data {
-                            id
-                        }
-                    }
-                }
-                SOME_VALUE_TEXT,
-        )]
+        #[\SomeNewAttribute('execute ($id: ID!) {
+    run(id: $id) {
+        data {
+            id
+        }
+    }
+}')]
         private object $query,
     ) {}
 }
 
-?>

This PR fix it.

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @ruudk

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) August 29, 2025 08:33
@samsonasik samsonasik merged commit 56c93f6 into main Aug 29, 2025
49 checks passed
@samsonasik samsonasik deleted the handle-new-attribute branch August 29, 2025 08:35
arshidkv12 pushed a commit to arshidkv12/rector-src that referenced this pull request Sep 4, 2025
…DOC (rectorphp#7194)

* [Scope] Handle Scope refreshing on Attribute on print string with NOWDOC

* Fix

* Fix
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant