Skip to content
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

[Dependency Injection] Service declaration tags should allow array types #3251

Closed
tiagojsag opened this issue Feb 2, 2012 · 6 comments
Closed
Labels
Bug DependencyInjection Good first issue Ideal for your first contribution! (some Symfony experience may be required)

Comments

@tiagojsag
Copy link
Contributor

Hello,

Using the following yml service declation:

        - { name: acme.myservice, sections:{main:true, side:true} }```

produces a correct array when parsed in a ComplierPass, but then throws:

```ErrorException: Warning: DOMElement::setAttribute() expects parameter 2 to be string, 
array given in (...)vendor/symfony/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php line 141```
@vicb
Copy link
Contributor

vicb commented Mar 9, 2012

I think it should actually be the other way around: it should not accept arrays & should throw an exception when loading the yaml (to make it consistent with xml).

@denderello
Copy link
Contributor

I'd volunteer to solve this one.

@stof
Copy link
Member

stof commented Apr 4, 2012

@denderello any news about a fix for this ?

@vicb
Copy link
Contributor

vicb commented Apr 13, 2012

Task for the BHD: update the YamlFileLoader to check for scalar types (in order to be consistent with the XML format), add unit tests.

@phreaknerd
Copy link
Contributor

Should be fixed with: #3921

phreaknerd added a commit to phreaknerd/symfony that referenced this issue Apr 13, 2012
The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
fabpot added a commit that referenced this issue Apr 13, 2012
Commits
-------

3ae826a Fix issue #3251: Check attribute type of service tags

Discussion
----------

Fix issue #3251: Check attribute type of service tags

The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
@jmikola
Copy link
Contributor

jmikola commented Apr 13, 2012

@phreaknerd: Can this be closed? Github didn't auto-close this because "Fix issue #3251" probably wasn't picked up by its own issue-closing hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug DependencyInjection Good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

6 participants