{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/29161","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/29161/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/29161/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/29161/events","html_url":"https://github.com/symfony/symfony/issues/29161","id":379330635,"node_id":"MDU6SXNzdWUzNzkzMzA2MzU=","number":29161,"title":"AnnotationReader conflict with Carbon external library","user":{"login":"Cethy","id":735030,"node_id":"MDQ6VXNlcjczNTAzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/735030?v=4","gravatar_id":"","url":"https://api.github.com/users/Cethy","html_url":"https://github.com/Cethy","followers_url":"https://api.github.com/users/Cethy/followers","following_url":"https://api.github.com/users/Cethy/following{/other_user}","gists_url":"https://api.github.com/users/Cethy/gists{/gist_id}","starred_url":"https://api.github.com/users/Cethy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cethy/subscriptions","organizations_url":"https://api.github.com/users/Cethy/orgs","repos_url":"https://api.github.com/users/Cethy/repos","events_url":"https://api.github.com/users/Cethy/events{/privacy}","received_events_url":"https://api.github.com/users/Cethy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-09T21:37:32Z","updated_at":"2018-11-10T11:56:57Z","closed_at":null,"author_association":"NONE","body":"**Symfony version(s) affected**: 4.1.7\r\n\r\n**Description**  \r\nThe [Carbon library](https://github.com/briannesbitt/Carbon/) contains some `@alias` annotations in the code (used by their documentation generator). When extending Carbon in a symfony app class,  I got an exception :\r\n```\r\nIn AnnotationException.php line 54:\r\n\r\n  [Doctrine\\Common\\Annotations\\AnnotationException]\r\n  [Semantical Error] The annotation \"@alias\" in method Carbon\\CarbonImmutable::toDate() was never imported. Did you maybe forget to add a \"use\" statement fo\r\n  r this annotation?\r\n```\r\n\r\n**How to reproduce**  \r\n- vanilla symfony installation ;\r\n- `composer require nesbot/carbon`\r\n- add a class where it will parsed for routing (in my case) :\r\n```php\r\nuse Carbon\\CarbonImmutable;\r\nclass Foo extends CarbonImmutable{}\r\n```\r\n\r\n**Possible Solution**  \r\nFound a way to [globally ignore an annotation](https://stackoverflow.com/a/50719075/2572988), but it feels too hacky for me :\r\n```php\r\n<?php\r\nnamespace App;\r\nuse Symfony\\Component\\HttpKernel\\Kernel as BaseKernel;\r\nclass Kernel extends BaseKernel\r\n{\r\n    // ...\r\n    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)\r\n    {\r\n        AnnotationReader::addGlobalIgnoredName('alias');\r\n        // ...\r\n    }\r\n}\r\n```\r\nIs there a way to tell elegantly to the `annotation.reader` service to `addGlobalIgnoredName('alias)` ?\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/437578837","html_url":"https://github.com/symfony/symfony/issues/29161#issuecomment-437578837","issue_url":"https://api.github.com/repos/symfony/symfony/issues/29161","id":437578837,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzU3ODgzNw==","user":{"login":"Cethy","id":735030,"node_id":"MDQ6VXNlcjczNTAzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/735030?v=4","gravatar_id":"","url":"https://api.github.com/users/Cethy","html_url":"https://github.com/Cethy","followers_url":"https://api.github.com/users/Cethy/followers","following_url":"https://api.github.com/users/Cethy/following{/other_user}","gists_url":"https://api.github.com/users/Cethy/gists{/gist_id}","starred_url":"https://api.github.com/users/Cethy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cethy/subscriptions","organizations_url":"https://api.github.com/users/Cethy/orgs","repos_url":"https://api.github.com/users/Cethy/repos","events_url":"https://api.github.com/users/Cethy/events{/privacy}","received_events_url":"https://api.github.com/users/Cethy/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T11:56:57Z","updated_at":"2018-11-10T11:56:57Z","author_association":"NONE","body":"@kylekatarnls The solution you propose is \"puting the problem under the rug\" (hiding behind configuration convention), not useful to me.\r\n@iltar As of the last lines of my issue suggest, I am aware of this doctrine documentation, **I'm looking to use it correctly in symfony**."}}
{"actor":{"display_login":"Cethy"}}