{"action":"opened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/26105","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/26105/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/26105/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/26105/events","html_url":"https://github.com/symfony/symfony/issues/26105","id":295818286,"number":26105,"title":"[XmlFileLoader] — Throw exception when key is not a string?","user":{"login":"roukmoute","id":2140469,"avatar_url":"https://avatars3.githubusercontent.com/u/2140469?v=4","gravatar_id":"","url":"https://api.github.com/users/roukmoute","html_url":"https://github.com/roukmoute","followers_url":"https://api.github.com/users/roukmoute/followers","following_url":"https://api.github.com/users/roukmoute/following{/other_user}","gists_url":"https://api.github.com/users/roukmoute/gists{/gist_id}","starred_url":"https://api.github.com/users/roukmoute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roukmoute/subscriptions","organizations_url":"https://api.github.com/users/roukmoute/orgs","repos_url":"https://api.github.com/users/roukmoute/repos","events_url":"https://api.github.com/users/roukmoute/events{/privacy}","received_events_url":"https://api.github.com/users/roukmoute/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T10:12:27Z","updated_at":"2018-02-09T10:12:27Z","closed_at":null,"author_association":"NONE","body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | perhaps\r\n| Feature request? | perhaps\r\n| BC Break report? | no\r\n| RFC?             | no\r\n| Symfony version  | 3.3\r\n\r\nIs it normal that we can get a `key` is not a string when it is not possible to have a key that is not a character string.\r\nSo if we have anything like that:\r\n```xml\r\n<parameter id=\"my.options\" type=\"collection\"/>\r\n```\r\nWe get in ParameterBag in our container, something like that (via `$container->getParameterBag->all()`):\r\n```php\r\n…\r\n0 => [],\r\n…\r\n```\r\n\r\nAnd as we know, it is not correct to have this.\r\n\r\nSi I can do a new P.R. with something like that:\r\n```php\r\nif (false === is_string($key) && 'parameter' === $arg->tagName && false === empty($arg->getAttribute('type'))) {\r\n    throw new InvalidArgumentException(sprintf('Parameter \"%s\" has no \"key\" string in \"%s\".', simplexml_import_dom($arg)->asXML(), $file));\r\n}\r\n```"}}
{"actor":{"display_login":"roukmoute"}}