{"action":"created","issue":{"url":"https://api.github.com/repos/padawan-php/padawan.php/issues/73","repository_url":"https://api.github.com/repos/padawan-php/padawan.php","labels_url":"https://api.github.com/repos/padawan-php/padawan.php/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/padawan-php/padawan.php/issues/73/comments","events_url":"https://api.github.com/repos/padawan-php/padawan.php/issues/73/events","html_url":"https://github.com/padawan-php/padawan.php/issues/73","id":196910301,"number":73,"title":"Inline @var syntax","user":{"login":"kokx","id":138556,"avatar_url":"https://avatars.githubusercontent.com/u/138556?v=3","gravatar_id":"","url":"https://api.github.com/users/kokx","html_url":"https://github.com/kokx","followers_url":"https://api.github.com/users/kokx/followers","following_url":"https://api.github.com/users/kokx/following{/other_user}","gists_url":"https://api.github.com/users/kokx/gists{/gist_id}","starred_url":"https://api.github.com/users/kokx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokx/subscriptions","organizations_url":"https://api.github.com/users/kokx/orgs","repos_url":"https://api.github.com/users/kokx/repos","events_url":"https://api.github.com/users/kokx/events{/privacy}","received_events_url":"https://api.github.com/users/kokx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-21T11:31:25Z","updated_at":"2016-12-30T03:06:30Z","closed_at":null,"body":"Implement inline `@var` syntax.\r\n\r\nSometimes, you know for a fact that some function returns a certain type. However, type hinting won't work because the function is too generic for that. For example, with the ZF2 ServiceManager:\r\n\r\n```php\r\n<?php\r\nuse My\\Job;\r\n\r\n$job = $sm->get(Job::class);\r\n/* @var $job Job */\r\n\r\n$job->...\r\n```\r\n\r\nIn this case, it would be great to have autocompletion for `$job` as well. However, padawan.php just marks it as a generic `object`.\r\n\r\nThis syntax has been implemented by many IDE's, for example [NetBeans](https://blogs.oracle.com/netbeansphp/entry/defining_a_variable_type_in).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/padawan-php/padawan.php/issues/comments/269726499","html_url":"https://github.com/padawan-php/padawan.php/issues/73#issuecomment-269726499","issue_url":"https://api.github.com/repos/padawan-php/padawan.php/issues/73","id":269726499,"user":{"login":"halftan","id":1898104,"avatar_url":"https://avatars.githubusercontent.com/u/1898104?v=3","gravatar_id":"","url":"https://api.github.com/users/halftan","html_url":"https://github.com/halftan","followers_url":"https://api.github.com/users/halftan/followers","following_url":"https://api.github.com/users/halftan/following{/other_user}","gists_url":"https://api.github.com/users/halftan/gists{/gist_id}","starred_url":"https://api.github.com/users/halftan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halftan/subscriptions","organizations_url":"https://api.github.com/users/halftan/orgs","repos_url":"https://api.github.com/users/halftan/repos","events_url":"https://api.github.com/users/halftan/events{/privacy}","received_events_url":"https://api.github.com/users/halftan/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T03:06:30Z","updated_at":"2016-12-30T03:06:30Z","body":"will implement in #80, @kokx @pbogut please checkout my development branch to test the feature.\r\nThe inline type hinting formats are:\r\n```php\r\n// Eclipse's approach of type hint\r\n/** @var $inst Class */\r\n$inst = new $className();\r\n\r\n// phpdoc-like approach\r\nfor ($items as $item) {\r\n    /** @var Class $item */\r\n}\r\n\r\n// also works in closure\r\narray_map($array, function($a, $b) {\r\n    /** @var Class $a */\r\n    /** @var Class $b */\r\n    // or maybe in block\r\n    /**\r\n     * @var Class $a\r\n     * @var Class $b\r\n     **/\r\n});\r\n```"}}
{"actor":{"display_login":"halftan"}}