{"action":"created","issue":{"url":"https://api.github.com/repos/phan/phan/issues/1588","repository_url":"https://api.github.com/repos/phan/phan","labels_url":"https://api.github.com/repos/phan/phan/issues/1588/labels{/name}","comments_url":"https://api.github.com/repos/phan/phan/issues/1588/comments","events_url":"https://api.github.com/repos/phan/phan/issues/1588/events","html_url":"https://github.com/phan/phan/issues/1588","id":306867648,"number":1588,"title":"unexpected \"PhanNonClassMethodCall Call to method doSomething on non-class type \\myCallee[]\"","user":{"login":"staabm","id":120441,"avatar_url":"https://avatars2.githubusercontent.com/u/120441?v=4","gravatar_id":"","url":"https://api.github.com/users/staabm","html_url":"https://github.com/staabm","followers_url":"https://api.github.com/users/staabm/followers","following_url":"https://api.github.com/users/staabm/following{/other_user}","gists_url":"https://api.github.com/users/staabm/gists{/gist_id}","starred_url":"https://api.github.com/users/staabm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staabm/subscriptions","organizations_url":"https://api.github.com/users/staabm/orgs","repos_url":"https://api.github.com/users/staabm/repos","events_url":"https://api.github.com/users/staabm/events{/privacy}","received_events_url":"https://api.github.com/users/staabm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-20T13:35:10Z","updated_at":"2018-03-21T04:01:04Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"```php\r\n<?php\r\n\r\nclass myCallee {\r\n    /**\r\n     * @return myCallee[]\r\n     */\r\n    public function returnsArray() {\r\n        $ar = array();\r\n        return $ar;\r\n    }\r\n\r\n    public function doSomething() {\r\n        echo \"done\";\r\n    }\r\n}\r\n\r\nclass myclass {\r\n    public function doA() {\r\n        $c = new myCallee();\r\n        $this->prop = $c->returnsArray();\r\n    }\r\n\r\n    public function doB() {\r\n        $this->prop = new myCallee();\r\n        $this->prop->doSomething(); // line 25\r\n    }\r\n}\r\n```\r\n\r\nemits `lib/phantest.php:25 PhanNonClassMethodCall Call to method doSomething on non-class type \\myCallee[]` which I didn't expected."},"comment":{"url":"https://api.github.com/repos/phan/phan/issues/comments/374828700","html_url":"https://github.com/phan/phan/issues/1588#issuecomment-374828700","issue_url":"https://api.github.com/repos/phan/phan/issues/1588","id":374828700,"user":{"login":"TysonAndre","id":1904430,"avatar_url":"https://avatars2.githubusercontent.com/u/1904430?v=4","gravatar_id":"","url":"https://api.github.com/users/TysonAndre","html_url":"https://github.com/TysonAndre","followers_url":"https://api.github.com/users/TysonAndre/followers","following_url":"https://api.github.com/users/TysonAndre/following{/other_user}","gists_url":"https://api.github.com/users/TysonAndre/gists{/gist_id}","starred_url":"https://api.github.com/users/TysonAndre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TysonAndre/subscriptions","organizations_url":"https://api.github.com/users/TysonAndre/orgs","repos_url":"https://api.github.com/users/TysonAndre/repos","events_url":"https://api.github.com/users/TysonAndre/events{/privacy}","received_events_url":"https://api.github.com/users/TysonAndre/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T04:01:04Z","updated_at":"2018-03-21T04:01:04Z","author_association":"COLLABORATOR","body":"In the meantime, this can be worked around by the following methods (Assuming that there isn't magic code inspecting properties)\r\n\r\n- Adding `/** @phan-property mixed $prop` to `myclass` is probably the safest\r\n- Adding `/** @var mixed */ public $prop` would also work."}}
{"actor":{"display_login":"TysonAndre"}}