{"action":"created","issue":{"url":"https://api.github.com/repos/php-fig/fig-standards/issues/714","labels_url":"https://api.github.com/repos/php-fig/fig-standards/issues/714/labels{/name}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/issues/714/comments","events_url":"https://api.github.com/repos/php-fig/fig-standards/issues/714/events","html_url":"https://github.com/php-fig/fig-standards/issues/714","id":123630842,"number":714,"title":"[coding style] Standard to mark deprecated classes ","user":{"login":"mvar","id":1286752,"avatar_url":"https://avatars.githubusercontent.com/u/1286752?v=3","gravatar_id":"","url":"https://api.github.com/users/mvar","html_url":"https://github.com/mvar","followers_url":"https://api.github.com/users/mvar/followers","following_url":"https://api.github.com/users/mvar/following{/other_user}","gists_url":"https://api.github.com/users/mvar/gists{/gist_id}","starred_url":"https://api.github.com/users/mvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvar/subscriptions","organizations_url":"https://api.github.com/users/mvar/orgs","repos_url":"https://api.github.com/users/mvar/repos","events_url":"https://api.github.com/users/mvar/events{/privacy}","received_events_url":"https://api.github.com/users/mvar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-23T09:53:49Z","updated_at":"2016-01-25T21:10:31Z","closed_at":"2016-01-25T21:10:31Z","body":"Newer Symfony versions introduced nice feature - error triggering for deprecated classes. I think this is VERY useful for end user. When user tries to use class, immediately gets error that this class is deprecated. See example below.\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Foo;\r\n\r\n@trigger_error(\r\n    'The XXX class is deprecated and will be removed in 2.0. Use YYY instead.',\r\n    E_USER_DEPRECATED\r\n);\r\n\r\nuse Bar\\YYY;\r\n\r\n/**\r\n * @deprecated Will be removed in 2.0. Use the YYY instead.\r\n */\r\nclass XXX extends YYY\r\n{\r\n}\r\n```\r\n\r\nThis file-level error triggering is so great because you can get \"deprecated\" message even when you don't call any method from that class.\r\n\r\nThe only problem is that source code given above does not comply PSR2:\r\n\r\n> A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both.\r\n\r\nWhat if we add special rule/exception for this \"deprecated\" case?"},"comment":{"url":"https://api.github.com/repos/php-fig/fig-standards/issues/comments/174663994","html_url":"https://github.com/php-fig/fig-standards/issues/714#issuecomment-174663994","issue_url":"https://api.github.com/repos/php-fig/fig-standards/issues/714","id":174663994,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T21:10:31Z","updated_at":"2016-01-25T21:10:31Z","body":"I prefer to close this discussion. Issues are to be removed anyway soon so if you want to discuss it further, let's get to mailing list: https://groups.google.com/forum/#!forum/php-fig"}}