Skip to content

[DI] 3.4 Service definitions with line breaks in arguments/properties dumped incorrectly when as_files option used #24470

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

Closed
Strate opened this issue Oct 6, 2017 · 0 comments

Comments

@Strate
Copy link
Contributor

Strate commented Oct 6, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4.x

Assume we have a service with multi-line string used as value for property:

    some_service_id:
        class: stdClass
        properties:
            test1: 1
            test2: >
                Text (
                    Inner Text
                )
            test3: 321

This is how this definition dumped to php code when PhpDumper used with as_files option (default):

<?php

use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;

// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
// Returns the public 'some_service_id' shared service.

$this->services['some_service_id'] = $instance = new \stdClass();

$instance->test1 = 1;
$instance->test2 = 'Text (
r Text


$instance->test3 = 321;

return $instance;

This file contains incorrect test2 property, and incorrect syntax.

@chalasr chalasr added this to the 3.4 milestone Oct 8, 2017
@nicolas-grekas nicolas-grekas removed this from the 3.4 milestone Oct 8, 2017
Strate added a commit to Strate/symfony that referenced this issue Oct 11, 2017
Handle the case, when exporting string contains new line, which cause
incorrect php code together with `as_files` option

fixes symfony#24470
@chalasr chalasr closed this as completed Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants