{"action":"opened","issue":{"url":"https://api.github.com/repos/api-platform/core/issues/1556","repository_url":"https://api.github.com/repos/api-platform/core","labels_url":"https://api.github.com/repos/api-platform/core/issues/1556/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/core/issues/1556/comments","events_url":"https://api.github.com/repos/api-platform/core/issues/1556/events","html_url":"https://github.com/api-platform/core/issues/1556","id":280467398,"number":1556,"title":"Autowiring Doctrine ORM Extension lead to deprecated","user":{"login":"raziel057","id":652505,"avatar_url":"https://avatars1.githubusercontent.com/u/652505?v=4","gravatar_id":"","url":"https://api.github.com/users/raziel057","html_url":"https://github.com/raziel057","followers_url":"https://api.github.com/users/raziel057/followers","following_url":"https://api.github.com/users/raziel057/following{/other_user}","gists_url":"https://api.github.com/users/raziel057/gists{/gist_id}","starred_url":"https://api.github.com/users/raziel057/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raziel057/subscriptions","organizations_url":"https://api.github.com/users/raziel057/orgs","repos_url":"https://api.github.com/users/raziel057/repos","events_url":"https://api.github.com/users/raziel057/events{/privacy}","received_events_url":"https://api.github.com/users/raziel057/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-08T12:00:47Z","updated_at":"2017-12-08T12:00:47Z","closed_at":null,"author_association":"NONE","body":"I created a specific action that use a FilterExtension as you can see on the code bellow:\r\n\r\n```php\r\nfinal class TicketAmountAction\r\n{\r\n    private $entityManager;\r\n\r\n    public function __construct(EntityManagerInterface $entityManager, FilterExtension $filterExtension)\r\n    {\r\n        $this->entityManager = $entityManager;\r\n        $this->filterExtension = $filterExtension;\r\n    }\r\n\r\n    /**\r\n     * @Route(\"/services/tickets/amount\", name=\"api_ticket_amount\")\r\n     * @Method({\"GET\"})\r\n     */\r\n    public function __invoke(string $status)\r\n    {\r\n        $qb = $this->entityManager->createQueryBuilder()\r\n            ->select('sum(o.price)')\r\n            ->from(Ticket::class, 'o');\r\n\r\n        $this->filterExtension->applyToCollection($qb, new QueryNameGenerator(), Ticket::class);\r\n\r\n        $amount = (int) $qb->getQuery()->getSingleScalarResult();\r\n\r\n        return new JsonResponse($amount);\r\n    }\r\n}\r\n```\r\n\r\nBut Symfony throw a deprecation exception:\r\n\r\n``\r\nAutowiring services based on the  types they implement is deprecated since Symfony 3.3 and won't be  supported in version 4.0. You should rename (or alias) the \"api_platform.doctrine.orm.query_extension.filter\" service to \"ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\FilterExtension\" instead.\r\n``\r\n\r\nAs a workarround, I can declare the following service in my app:\r\n```yaml\r\nservices:\r\n    ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\FilterExtension:\r\n        alias: api_platform.doctrine.orm.query_extension.filter\r\n```\r\n\r\nWould it be possible to modify the configuration of those ORM extension services to make them \"Autowireable\" without deprecation."}}
{"actor":{"display_login":"raziel057"}}