{"action":"created","issue":{"url":"https://api.github.com/repos/etsy/phan/issues/313","repository_url":"https://api.github.com/repos/etsy/phan","labels_url":"https://api.github.com/repos/etsy/phan/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/etsy/phan/issues/313/comments","events_url":"https://api.github.com/repos/etsy/phan/issues/313/events","html_url":"https://github.com/etsy/phan/issues/313","id":169804907,"number":313,"title":"The \"@var\" type comments on variables are ignored","user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/etsy/phan/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"morria","id":387209,"avatar_url":"https://avatars.githubusercontent.com/u/387209?v=3","gravatar_id":"","url":"https://api.github.com/users/morria","html_url":"https://github.com/morria","followers_url":"https://api.github.com/users/morria/followers","following_url":"https://api.github.com/users/morria/following{/other_user}","gists_url":"https://api.github.com/users/morria/gists{/gist_id}","starred_url":"https://api.github.com/users/morria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morria/subscriptions","organizations_url":"https://api.github.com/users/morria/orgs","repos_url":"https://api.github.com/users/morria/repos","events_url":"https://api.github.com/users/morria/events{/privacy}","received_events_url":"https://api.github.com/users/morria/received_events","type":"User","site_admin":false},"assignees":[{"login":"morria","id":387209,"avatar_url":"https://avatars.githubusercontent.com/u/387209?v=3","gravatar_id":"","url":"https://api.github.com/users/morria","html_url":"https://github.com/morria","followers_url":"https://api.github.com/users/morria/followers","following_url":"https://api.github.com/users/morria/following{/other_user}","gists_url":"https://api.github.com/users/morria/gists{/gist_id}","starred_url":"https://api.github.com/users/morria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morria/subscriptions","organizations_url":"https://api.github.com/users/morria/orgs","repos_url":"https://api.github.com/users/morria/repos","events_url":"https://api.github.com/users/morria/events{/privacy}","received_events_url":"https://api.github.com/users/morria/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2016-08-07T16:46:52Z","updated_at":"2016-08-09T14:47:53Z","closed_at":null,"body":"I have code like this:\r\n\r\n```php\r\nclass kApplication\r\n{\r\n\r\n    /**\r\n     * Get's real class name for pseudo class\r\n     *\r\n     * @param string $pseudo_class\r\n     *\r\n     * @return kBase\r\n     */\r\n    public function makeClass($pseudo_class, $arguments = Array ())\r\n    {\r\n        return $this->Factory->makeClass($pseudo_class, $arguments);\r\n    }\r\n\r\n    public function testMethod()\r\n    {\r\n        /** @var kEmail $email */\r\n        $email = $this->makeClass('....');\r\n        $email->sendEmail();\r\n    }\r\n\r\n}\r\n```\r\n\r\nDuring analysis process only `@return` annotation of `\\kApplication::makeClass` method is inspected and `@var` type override annotation in the `\\kApplication::testMethod` method isn't taken into account.\r\n\r\nThis results in `$email` variable in `\\kApplication::testMethod` method considered of `kBase` type instead of `kEmail` type.\r\n\r\nError message I'm getting is:\r\n\r\n```\r\ncore/kernel/application.php:2542 PhanUndeclaredMethod Call to undeclared method \\kBase::sendEmail\r\n```\r\n\r\nThe `Comment::fromStringInContext` call in Phan is dealing with such things, but it only is used to parse DocBlock of function/method/class/class property, but not variables inside methods/functions.\r\n\r\nI have `should_visit_all_nodes` config setting enabled."},"comment":{"url":"https://api.github.com/repos/etsy/phan/issues/comments/238577056","html_url":"https://github.com/etsy/phan/issues/313#issuecomment-238577056","issue_url":"https://api.github.com/repos/etsy/phan/issues/313","id":238577056,"user":{"login":"jazzdan","id":452453,"avatar_url":"https://avatars.githubusercontent.com/u/452453?v=3","gravatar_id":"","url":"https://api.github.com/users/jazzdan","html_url":"https://github.com/jazzdan","followers_url":"https://api.github.com/users/jazzdan/followers","following_url":"https://api.github.com/users/jazzdan/following{/other_user}","gists_url":"https://api.github.com/users/jazzdan/gists{/gist_id}","starred_url":"https://api.github.com/users/jazzdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazzdan/subscriptions","organizations_url":"https://api.github.com/users/jazzdan/orgs","repos_url":"https://api.github.com/users/jazzdan/repos","events_url":"https://api.github.com/users/jazzdan/events{/privacy}","received_events_url":"https://api.github.com/users/jazzdan/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T14:47:53Z","updated_at":"2016-08-09T14:47:53Z","body":"@aik099 ,\r\n> If col/line information of variable declaration is preserved in AST tree, then indeed we can get comment from original source file if it is present.\r\n\r\nJust as an FYI, only line number is preserved. Unfortunately column number is not preserved. :("}}
{"actor":{"display_login":"jazzdan"}}