Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Handle the case, when exporting string contains new line, which causeincorrect php code together with `as_files` optionfixessymfony#24470
nicolas-grekas commentedOct 12, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
nicolas-grekas commentedOct 12, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OH got it :) "new line" is missing when the patch is not applied! |
Strate commentedOct 12, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas yes. Generated code become invalid if test case changed from UPD, just tested that, it compiles to: |
nicolas-grekas commentedOct 12, 2017
Can you submit the fix on 2.7? |
Strate commentedOct 12, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@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 | noSee 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
xabbuh commentedOct 12, 2017
Isn't this fixed by#24532? |
Strate commentedOct 12, 2017
@xabbuh this was created firstly, and this targets to 3.4 |
xabbuh commentedOct 12, 2017
Lower branches are merged up regularly. So the other fix will land in 3.4 eventually. |
Strate commentedOct 12, 2017
But here is more unit test, target to as_files dumper option |
chalasr commentedOct 17, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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_filesoptionfixes#24470