{"action":"closed","issue":{"url":"https://api.github.com/repos/phpstan/phpstan/issues/1196","repository_url":"https://api.github.com/repos/phpstan/phpstan","labels_url":"https://api.github.com/repos/phpstan/phpstan/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/phpstan/phpstan/issues/1196/comments","events_url":"https://api.github.com/repos/phpstan/phpstan/issues/1196/events","html_url":"https://github.com/phpstan/phpstan/issues/1196","id":339893425,"node_id":"MDU6SXNzdWUzMzk4OTM0MjU=","number":1196,"title":"optional return throw Cannot call method getId() on Bar|null","user":{"login":"jdeniau","id":1398469,"node_id":"MDQ6VXNlcjEzOTg0Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-10T15:26:07Z","updated_at":"2018-07-10T21:08:04Z","closed_at":"2018-07-10T21:08:04Z","author_association":"NONE","body":"### Summary of a problem or a feature request\r\n\r\noptional return in function call report an wrong error\r\n\r\n### Code snippet that reproduces the problem\r\n\r\nhttps://phpstan.org/r/1f7d9120dfb1ba424c1c00e2de646e24\r\n\r\n### Expected output\r\nas `getBar()` return an object|null, the `if` return true only if `getBar` return an object, thus, we can call `getId()` on it.\r\n\r\ntesting explicitly strict equality with `null` works fine as showned [here](https://phpstan.org/r/4be305478de96dc9c2258a0ec9c5611b)\r\n"}}
{"actor":{"display_login":"ondrejmirtes"}}