Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodingStyle] Skip EncapsedStringsToSprintfRector on heredoc #3242

Merged
merged 3 commits into from Dec 23, 2022

Conversation

samsonasik
Copy link
Member

Given the following code:

final class SkipInHeredoc
{
    public function run(string $data)
    {
        $data = 'test';
        $value = <<<CODE
                            Some {$data}
CODE;

        echo $value;
    }
}

In currently produce:

     public function run(string $data)
     {
         $data = 'test';
-        $value = <<<CODE
-                            Some {$data}
-CODE;
+        $value = sprintf('                            Some %s', $data);

ref https://getrector.org/demo/bccdea1b-fd0c-4c7a-8587-905ffa440a76

which I think should be skipped.

@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 8862942 into main Dec 23, 2022
@TomasVotruba
Copy link
Member

Thank you

@TomasVotruba TomasVotruba deleted the skip-in-hereodc branch December 23, 2022 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants