Skip to content

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Mar 28, 2017

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes/no
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

Given

class Foo {
    private $bars;
    public function __construct(array $bars) {
        $this->bars = $bars;
    }
}
services:
    a: { class: stdClass }
    b: { class: stdClass }
    Foo: [!iterator ['@a', '@b']]
dump($this->get(Foo::class));

Before

Catchable Fatal Error: Argument 1 passed to AppBundle\Foo::__construct() must be of the type array, object given

After

Foo {#223 ▼
  -bars: array:2 [▼
    0 => {#224}
    1 => {#222}
  ]
}

@nicolas-grekas
Copy link
Member

👎 the config should be fixed instead.

@ro0NL
Copy link
Contributor Author

ro0NL commented Mar 28, 2017

on 2nd thought this should probably just be built-in with #22200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants