{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/23478","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/23478/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/23478/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/23478/events","html_url":"https://github.com/symfony/symfony/issues/23478","id":242049799,"number":23478,"title":"Dynamical arguments have to be in first position when autowiring","user":{"login":"Vinorcola","id":2178680,"avatar_url":"https://avatars3.githubusercontent.com/u/2178680?v=4","gravatar_id":"","url":"https://api.github.com/users/Vinorcola","html_url":"https://github.com/Vinorcola","followers_url":"https://api.github.com/users/Vinorcola/followers","following_url":"https://api.github.com/users/Vinorcola/following{/other_user}","gists_url":"https://api.github.com/users/Vinorcola/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinorcola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinorcola/subscriptions","organizations_url":"https://api.github.com/users/Vinorcola/orgs","repos_url":"https://api.github.com/users/Vinorcola/repos","events_url":"https://api.github.com/users/Vinorcola/events{/privacy}","received_events_url":"https://api.github.com/users/Vinorcola/received_events","type":"User","site_admin":false},"labels":[{"id":99863,"url":"https://api.github.com/repos/symfony/symfony/labels/DependencyInjection","name":"DependencyInjection","color":"DDDDDD","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-07-11T13:35:27Z","updated_at":"2017-07-18T14:20:38Z","closed_at":"2017-07-12T08:02:14Z","body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | yes\r\n| Feature request? | no\r\n| BC Break report? | no\r\n| RFC?             | no\r\n| Symfony version  | 3.3.4\r\n\r\nIt looks like if some services are autowired, it is not possible to dynamically change an argument (with `replaceArgument()`) into the bundle extension except if that argument is in first position.\r\n\r\n```\r\nPHP Fatal error:  Uncaught Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException: Invalid constructor argument 5 for service \"My\\PrivateBundle\\Model\\SecurityModel\": argument 1 must be defined before. Check your service definition. in /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php:41\r\nStack trace:\r\n#0 /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php(57): Symfony\\Component\\DependencyInjection\\Compiler\\CheckArgumentsValidityPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\r\n#1 /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php(31): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, true)\r\n#2 /projects/MyPrivateBundle/ven in /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php on line 41\r\nPHP Fatal error:  Uncaught Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException: Invalid constructor argument 5 for service \"My\\PrivateBundle\\Model\\SecurityModel\": argument 1 must be defined before. Check your service definition. in /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php:41\r\nStack trace:\r\n#0 /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php(57): Symfony\\Component\\DependencyInjection\\Compiler\\CheckArgumentsValidityPass->processValue(Object(Symfony\\Component\\DependencyInjection\\Definition), true)\r\n#1 /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php(31): Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass->processValue(Array, true)\r\n#2 /projects/MyPrivateBundle/ven in /projects/MyPrivateBundle/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckArgumentsValidityPass.php on line 41\r\n```\r\n\r\nPlease check complete context here: https://gist.github.com/Vinorcola/472d4ae9e428b77af4b0c58ad306d123"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/316079114","html_url":"https://github.com/symfony/symfony/issues/23478#issuecomment-316079114","issue_url":"https://api.github.com/repos/symfony/symfony/issues/23478","id":316079114,"user":{"login":"biliboo","id":6705077,"avatar_url":"https://avatars1.githubusercontent.com/u/6705077?v=4","gravatar_id":"","url":"https://api.github.com/users/biliboo","html_url":"https://github.com/biliboo","followers_url":"https://api.github.com/users/biliboo/followers","following_url":"https://api.github.com/users/biliboo/following{/other_user}","gists_url":"https://api.github.com/users/biliboo/gists{/gist_id}","starred_url":"https://api.github.com/users/biliboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biliboo/subscriptions","organizations_url":"https://api.github.com/users/biliboo/orgs","repos_url":"https://api.github.com/users/biliboo/repos","events_url":"https://api.github.com/users/biliboo/events{/privacy}","received_events_url":"https://api.github.com/users/biliboo/received_events","type":"User","site_admin":false},"created_at":"2017-07-18T14:20:38Z","updated_at":"2017-07-18T14:20:38Z","body":"Well, I'm a bit embarrassed since I'm migrating from 3.2 to 3.3. And in a new 3.3 project everything works as expected.\r\n\r\nThe issue occurs during the initialization fo the Definition arguments of the service. I continue the research..."}}
{"actor":{"display_login":"biliboo"}}