-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: apply (partially) multiline_string_to_heredoc
#9002
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main work was done by MultilineStringToHeredocFixer
, where I temporary changed the heredoc/nowdoc marker from "EOD" to "PHP".
@@ -33,10 +33,16 @@ public function getDefinition(): FixerDefinitionInterface | |||
{ | |||
return new FixerDefinition( | |||
'If the function explicitly returns an array, and has the return type `iterable`, then `yield from` must be used instead of `return`.', | |||
[new CodeSample('<?php function giveMeData(): iterable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In those cases I manually added newlines after the changes of the fixer.
@@ -120,33 +120,48 @@ public function getDefinition(): FixerDefinitionInterface | |||
'Ordering `use` statements.', | |||
[ | |||
new CodeSample( | |||
"<?php\nuse function AAC;\nuse const AAB;\nuse AAA;\n" | |||
<<<'PHP' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fixer didn't change these oneliners. I converted some of them manually.
+sample(); $test = 1; | ||
+sample(); $test = 2; | ||
+for ( ; ; ++$sample) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see that the string content of the samples didn't changed because the generated doc files didn't changed.
Only exception was this sample here where I changed the indentation intentionally..
multiline_string_to_heredoc
thank you |
No description provided.