{"action":"created","issue":{"url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/136","labels_url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/136/comments","events_url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/136/events","html_url":"https://github.com/ongr-io/ongr-strict-standard/issues/136","id":104251179,"number":136,"title":"Checker throws PHP notices on empty function @return comments.","user":{"login":"kewlar","id":1241866,"avatar_url":"https://avatars.githubusercontent.com/u/1241866?v=3","gravatar_id":"","url":"https://api.github.com/users/kewlar","html_url":"https://github.com/kewlar","followers_url":"https://api.github.com/users/kewlar/followers","following_url":"https://api.github.com/users/kewlar/following{/other_user}","gists_url":"https://api.github.com/users/kewlar/gists{/gist_id}","starred_url":"https://api.github.com/users/kewlar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewlar/subscriptions","organizations_url":"https://api.github.com/users/kewlar/orgs","repos_url":"https://api.github.com/users/kewlar/repos","events_url":"https://api.github.com/users/kewlar/events{/privacy}","received_events_url":"https://api.github.com/users/kewlar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-01T12:11:58Z","updated_at":"2015-09-01T12:40:25Z","closed_at":null,"body":"Let's say we have a `@return int ` in a function's docblock.  Here, `$token['content'] === 'int '`. The result:\r\n\r\n```\r\nPHP Notice: Uninitialized string offset: 0 in .../ongr/ongr-strict-standard/Ongr/Sniffs/Commenting/FunctionCommentSniff.php on line 313\r\n```\r\n\r\nThe sniffer correctly reports \"Whitespace found at end of line\", but it also incorrectly adds \"Return comment must start with a capital letter\" and \"Return comment must end with a full stop\". There should not be further errors about a return comment, because there is no return comment.\r\n\r\nThe bug is both in 2.x and in master branches (line 332 on master branch)."},"comment":{"url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/comments/136701509","html_url":"https://github.com/ongr-io/ongr-strict-standard/issues/136#issuecomment-136701509","issue_url":"https://api.github.com/repos/ongr-io/ongr-strict-standard/issues/136","id":136701509,"user":{"login":"kewlar","id":1241866,"avatar_url":"https://avatars.githubusercontent.com/u/1241866?v=3","gravatar_id":"","url":"https://api.github.com/users/kewlar","html_url":"https://github.com/kewlar","followers_url":"https://api.github.com/users/kewlar/followers","following_url":"https://api.github.com/users/kewlar/following{/other_user}","gists_url":"https://api.github.com/users/kewlar/gists{/gist_id}","starred_url":"https://api.github.com/users/kewlar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kewlar/subscriptions","organizations_url":"https://api.github.com/users/kewlar/orgs","repos_url":"https://api.github.com/users/kewlar/repos","events_url":"https://api.github.com/users/kewlar/events{/privacy}","received_events_url":"https://api.github.com/users/kewlar/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T12:40:25Z","updated_at":"2015-09-01T12:40:25Z","body":"Sure thing (:\r\n\r\n```php\r\n    /**\r\n     * Get company\r\n     *\r\n     * @return \\Pim\\UserBundle\\Entity\\Company \r\n     */\r\n    public function getCompany()\r\n    {\r\n        return $this->company;\r\n    }\r\n```\r\n\r\nThe Doctrine entity code here was probably generated by an IDE or a `doctrine:generate:entities` command, and it -- stupidly -- left a space symbol at the end of the `@return` line (not sure if the comment will preserve the whitespace).\r\n\r\nThe code sniffer throws up on that:\r\n<img width=\"548\" alt=\"ongr-sniffer-error\" src=\"https://cloud.githubusercontent.com/assets/1241866/9604290/598e85f0-50bf-11e5-9e14-c60c2df15c7d.png\">\r\n\r\nIf you don't mind, I've got a test, and a fix. Pull request incoming in 3... 2... 1...\r\n "}}