-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] fixed PhpDumper + as_files + new lines in string arguments/properties/etc of Definitions #24517
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
Handle the case, when exporting string contains new line, which cause incorrect php code together with `as_files` option fixes symfony#24470
If I remove your change in PhpDumper, I get this change in the fixtures file: -return $this->services['foo'] = new \Foo('string with' . "\n" . 'new line');
+return $this->services['foo'] = new \Foo('string with
+'); The code without your change is thus perfectly fine. |
OH got it :) "new line" is missing when the patch is not applied! |
@nicolas-grekas yes. Generated code become invalid if test case changed from UPD, just tested that, it compiles to:
|
Can you submit the fix on 2.7? |
@nicolas-grekas I've made separate PR #24532 |
…ontains newlines (Strate) This PR was squashed before being merged into the 2.7 branch (closes #24532). Discussion ---------- [DI] Fix possible incorrect php-code when dumped strings contains newlines | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | ? | License | MIT | Doc PR | no See discussion #24517 <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the 3.4, legacy code removals go to the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- 345f2fc [DI] Fix possible incorrect php-code when dumped strings contains newlines
Isn't this fixed by #24532? |
@xabbuh this was created firstly, and this targets to 3.4 |
Lower branches are merged up regularly. So the other fix will land in 3.4 eventually. |
But here is more unit test, target to as_files dumper option |
The test added on 2.7 seems good enough, the value of |
Handle the case, when exporting string contains new line, which cause
incorrect php code together with
as_files
optionfixes #24470