{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/25194","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/25194/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/25194/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/25194/events","html_url":"https://github.com/symfony/symfony/issues/25194","id":277440251,"number":25194,"title":"[Symfony4][DIC] Autoconfigured services not fetchable from DIC.","user":{"login":"Rubinum","id":5645798,"avatar_url":"https://avatars1.githubusercontent.com/u/5645798?v=4","gravatar_id":"","url":"https://api.github.com/users/Rubinum","html_url":"https://github.com/Rubinum","followers_url":"https://api.github.com/users/Rubinum/followers","following_url":"https://api.github.com/users/Rubinum/following{/other_user}","gists_url":"https://api.github.com/users/Rubinum/gists{/gist_id}","starred_url":"https://api.github.com/users/Rubinum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rubinum/subscriptions","organizations_url":"https://api.github.com/users/Rubinum/orgs","repos_url":"https://api.github.com/users/Rubinum/repos","events_url":"https://api.github.com/users/Rubinum/events{/privacy}","received_events_url":"https://api.github.com/users/Rubinum/received_events","type":"User","site_admin":false},"labels":[{"id":100079,"url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":99863,"url":"https://api.github.com/repos/symfony/symfony/labels/DependencyInjection","name":"DependencyInjection","color":"DDDDDD","default":false},{"id":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false},{"id":520300257,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Waiting%20feedback","name":"Status: Waiting feedback","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-28T16:04:32Z","updated_at":"2017-11-28T16:36:19Z","closed_at":null,"author_association":"CONTRIBUTOR","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  | 4.0.0RC2\r\n\r\nMy autoconfigured service could not be loaded from DIC.\r\n\r\nMy Service:\r\n```\r\n# src/Service/Test.php\r\n<?php\r\n\r\nnamespace App\\Service;\r\n\r\n\r\nclass Test\r\n{\r\n    public function hello()\r\n    {\r\n        return 'Hello';\r\n    }\r\n\r\n}\r\n```\r\n\r\nMy services.yaml\r\n```\r\n# config/services.yaml\r\n# Put parameters here that don't need to change on each machine where the app is deployed\r\n# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration\r\nparameters:\r\n\r\nservices:\r\n    # default configuration for services in *this* file\r\n    _defaults:\r\n        # automatically injects dependencies in your services\r\n        autowire: true\r\n        # automatically registers your services as commands, event subscribers, etc.\r\n        autoconfigure: true\r\n        # this means you cannot fetch services directly from the container via $container->get()\r\n        # if you need to do this, you can override this setting on individual services\r\n        public: false\r\n\r\n    # makes classes in src/ available to be used as services\r\n    # this creates a service per class whose id is the fully-qualified class name\r\n    App\\:\r\n        resource: '../src/*'\r\n        # you can exclude directories or files\r\n        # but if a service is unused, it's removed anyway\r\n        exclude: '../src/{DataFixtures,Entity,Migrations,Tests}'\r\n\r\n    # controllers are imported separately to make sure they\r\n    # have the tag that allows actions to type-hint services\r\n    App\\Controller\\:\r\n        resource: '../src/Controller'\r\n        tags: ['controller.service_arguments']\r\n\r\n    App\\Services\\Test:\r\n        class: 'App\\Service\\Test'\r\n        public: true\r\n```  \r\n\r\nMy Controller:\r\n```\r\n# src/Controller/DefaultController.php\r\n<?php\r\n\r\nnamespace App\\Controller;\r\n\r\n\r\nuse App\\Service\\Test;\r\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\r\nuse Symfony\\Component\\HttpFoundation\\Response;\r\nuse Symfony\\Component\\Routing\\Annotation\\Route;\r\n\r\nclass DefaultController extends AbstractController\r\n{\r\n    /**\r\n     * @Route(\"/\", name=\"default\")\r\n     */\r\n    public function index()\r\n    {\r\n        $this->get(Test::class);\r\n        return new Response('Hello');\r\n    }\r\n}\r\n```\r\n\r\nIf try to execute this setup I got:\r\n![screenshot from 2017-11-28 17-03-43](https://user-images.githubusercontent.com/5645798/33330049-1d6e2f56-d45e-11e7-91e0-896527ef1a02.png)\r\n\r\nDo I miss something here or is this not intended?\r\nIf I remove `autoconfigure: true` then the issue disappears."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/347582550","html_url":"https://github.com/symfony/symfony/issues/25194#issuecomment-347582550","issue_url":"https://api.github.com/repos/symfony/symfony/issues/25194","id":347582550,"user":{"login":"chr-hertel","id":2852185,"avatar_url":"https://avatars1.githubusercontent.com/u/2852185?v=4","gravatar_id":"","url":"https://api.github.com/users/chr-hertel","html_url":"https://github.com/chr-hertel","followers_url":"https://api.github.com/users/chr-hertel/followers","following_url":"https://api.github.com/users/chr-hertel/following{/other_user}","gists_url":"https://api.github.com/users/chr-hertel/gists{/gist_id}","starred_url":"https://api.github.com/users/chr-hertel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr-hertel/subscriptions","organizations_url":"https://api.github.com/users/chr-hertel/orgs","repos_url":"https://api.github.com/users/chr-hertel/repos","events_url":"https://api.github.com/users/chr-hertel/events{/privacy}","received_events_url":"https://api.github.com/users/chr-hertel/received_events","type":"User","site_admin":false},"created_at":"2017-11-28T16:36:19Z","updated_at":"2017-11-28T16:36:19Z","author_association":"NONE","body":"thanks for the clarification!"}}
{"actor":{"display_login":"chr-hertel"}}