{"action":"closed","issue":{"url":"https://api.github.com/repos/etsy/phan/issues/337","repository_url":"https://api.github.com/repos/etsy/phan","labels_url":"https://api.github.com/repos/etsy/phan/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/etsy/phan/issues/337/comments","events_url":"https://api.github.com/repos/etsy/phan/issues/337/events","html_url":"https://github.com/etsy/phan/issues/337","id":179107027,"number":337,"title":"Functions should not have to return to be valid","user":{"login":"Seldaek","id":183678,"avatar_url":"https://avatars.githubusercontent.com/u/183678?v=3","gravatar_id":"","url":"https://api.github.com/users/Seldaek","html_url":"https://github.com/Seldaek","followers_url":"https://api.github.com/users/Seldaek/followers","following_url":"https://api.github.com/users/Seldaek/following{/other_user}","gists_url":"https://api.github.com/users/Seldaek/gists{/gist_id}","starred_url":"https://api.github.com/users/Seldaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seldaek/subscriptions","organizations_url":"https://api.github.com/users/Seldaek/orgs","repos_url":"https://api.github.com/users/Seldaek/repos","events_url":"https://api.github.com/users/Seldaek/events{/privacy}","received_events_url":"https://api.github.com/users/Seldaek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-25T20:27:16Z","updated_at":"2016-09-26T19:42:31Z","closed_at":"2016-09-26T19:42:31Z","body":"Given:\r\n\r\n```php\r\n    protected function getDefaultFormatter(): FormatterInterface\r\n    {\r\n        throw new \\InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\\Formatter\\FlowdockFormatter to function correctly');\r\n    }\r\n```\r\n\r\nI get this:\r\n\r\n```\r\nPhanTypeMissingReturn Method \\Monolog\\Handler\\FlowdockHandler::getDefaultFormatter is declared to return \\Monolog\\Formatter\\FormatterInterface but has no return value\r\n```\r\n\r\nObviously it's correct, but it's also something I can not possibly fix even with adding more type info AFAICS, so it'd be nice if it would go away :) Basically if you throw unconditionally the function will never return, but it has to be marked as returning as the interface dictates it. It's not a useful function, but it is valid code IMO."}}
{"actor":{"display_login":"rlerdorf"}}