{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/26193","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/26193/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/26193/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/26193/events","html_url":"https://github.com/symfony/symfony/pull/26193","id":297687684,"number":26193,"title":"Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler","user":{"login":"iquito","id":973653,"avatar_url":"https://avatars2.githubusercontent.com/u/973653?v=4","gravatar_id":"","url":"https://api.github.com/users/iquito","html_url":"https://github.com/iquito","followers_url":"https://api.github.com/users/iquito/followers","following_url":"https://api.github.com/users/iquito/following{/other_user}","gists_url":"https://api.github.com/users/iquito/gists{/gist_id}","starred_url":"https://api.github.com/users/iquito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iquito/subscriptions","organizations_url":"https://api.github.com/users/iquito/orgs","repos_url":"https://api.github.com/users/iquito/repos","events_url":"https://api.github.com/users/iquito/events{/privacy}","received_events_url":"https://api.github.com/users/iquito/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":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/10","html_url":"https://github.com/symfony/symfony/milestone/10","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/10/labels","id":2117464,"number":10,"title":"3.4","description":"https://symfony.com/roadmap?version=3.4#checker","creator":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars3.githubusercontent.com/u/73419?v=4","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":787,"state":"open","created_at":"2016-11-06T20:24:23Z","updated_at":"2018-05-14T06:38:52Z","due_on":"2020-11-30T08:00:00Z","closed_at":null},"comments":6,"created_at":"2018-02-16T05:49:35Z","updated_at":"2018-05-14T09:34:28Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/26193","html_url":"https://github.com/symfony/symfony/pull/26193","diff_url":"https://github.com/symfony/symfony/pull/26193.diff","patch_url":"https://github.com/symfony/symfony/pull/26193.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | 3.4\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #25518 \r\n| License       | MIT\r\n\r\nSymfony 3.4 emits deprecation warnings for  `TranslationLoader` and `WriteCheckSessionHandler` as soon as these classes are loaded, yet at the same time these classes are part of the default services defined in Symfony 3.4, so if these classes are loaded during container compilation a deprecation warning is emitted, even if these classes are never actually used.\r\n\r\nAn example would be the following within a compiler pass:\r\n\r\n    foreach ($containerBuilder->getDefinitions() as $definition) {\r\n      if (is_subclass_of($definition->getClass(), SomeClass::class)) {\r\n        $definition->addMethodCall('setSomething', [new Reference('someservice')]);\r\n      }\r\n    }\r\n\r\nThis will load both `TranslationLoader` and `WriteCheckSessionHandler` in order to check their definition.  No instance of the classes are ever used and the classes are not loaded after compilation ever, yet the deprecation notices are shown on every single page. More details are provided in issue #25518 .\r\n\r\nBy moving the deprecation notices to the class constructors false-positives are avoided while actual usage of the classes should still generate the deprecation warnings."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/388756075","html_url":"https://github.com/symfony/symfony/pull/26193#issuecomment-388756075","issue_url":"https://api.github.com/repos/symfony/symfony/issues/26193","id":388756075,"user":{"login":"nurtext","id":148175,"avatar_url":"https://avatars0.githubusercontent.com/u/148175?v=4","gravatar_id":"","url":"https://api.github.com/users/nurtext","html_url":"https://github.com/nurtext","followers_url":"https://api.github.com/users/nurtext/followers","following_url":"https://api.github.com/users/nurtext/following{/other_user}","gists_url":"https://api.github.com/users/nurtext/gists{/gist_id}","starred_url":"https://api.github.com/users/nurtext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nurtext/subscriptions","organizations_url":"https://api.github.com/users/nurtext/orgs","repos_url":"https://api.github.com/users/nurtext/repos","events_url":"https://api.github.com/users/nurtext/events{/privacy}","received_events_url":"https://api.github.com/users/nurtext/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T09:34:28Z","updated_at":"2018-05-14T09:34:28Z","author_association":"NONE","body":"Trying to find the source of this weird deprecation message for hours until I found this PR.\r\nIs there any other way to overcome this false-positive away from waiting for this to get merged?"}}
{"actor":{"display_login":"nurtext"}}