{"action":"opened","issue":{"url":"https://api.github.com/repos/vimeo/psalm/issues/575","repository_url":"https://api.github.com/repos/vimeo/psalm","labels_url":"https://api.github.com/repos/vimeo/psalm/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/vimeo/psalm/issues/575/comments","events_url":"https://api.github.com/repos/vimeo/psalm/issues/575/events","html_url":"https://github.com/vimeo/psalm/issues/575","id":305254982,"number":575,"title":"Generated return types should show optional keys","user":{"login":"muglug","id":2292638,"avatar_url":"https://avatars0.githubusercontent.com/u/2292638?v=4","gravatar_id":"","url":"https://api.github.com/users/muglug","html_url":"https://github.com/muglug","followers_url":"https://api.github.com/users/muglug/followers","following_url":"https://api.github.com/users/muglug/following{/other_user}","gists_url":"https://api.github.com/users/muglug/gists{/gist_id}","starred_url":"https://api.github.com/users/muglug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muglug/subscriptions","organizations_url":"https://api.github.com/users/muglug/orgs","repos_url":"https://api.github.com/users/muglug/repos","events_url":"https://api.github.com/users/muglug/events{/privacy}","received_events_url":"https://api.github.com/users/muglug/received_events","type":"User","site_admin":false},"labels":[{"id":486061588,"url":"https://api.github.com/repos/vimeo/psalm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-14T17:22:53Z","updated_at":"2018-03-14T17:22:53Z","closed_at":null,"author_association":"MEMBER","body":"Requires https://github.com/vimeo/psalm/issues/458\r\n\r\n```php\r\nfunction foo() {\r\n  if (rand(0, 1)) {\r\n    return [\"a\" => 5];\r\n  }\r\n  \r\n  return [\"b\" => 7];\r\n}\r\n```\r\n\r\nExpected error: `Method foo does not have a return type, expecting array{b?:int, a?:int}`\r\nActual error: `Method foo does not have a return type, expecting array{b:int, a:int}`\r\n\r\n```php\r\nfunction foo() {\r\n  if (rand(0, 1)) {\r\n    return [\"a\" => 5];\r\n  }\r\n  \r\n  return [\"a\" => 3, \"b\" => 7];\r\n}\r\n```\r\n\r\nExpected error: `Method foo does not have a return type, expecting array{a:int, b?:int}`\r\nActual error: `Method foo does not have a return type, expecting array{b:int, a:int}`"}}
{"actor":{"display_login":"muglug"}}