{"action":"created","comment":{"url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/comments/290204417","pull_request_review_id":245327692,"id":290204417,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5MDIwNDQxNw==","diff_hunk":"@@ -0,0 +1,61 @@\n+<?php\n+\n+declare(strict_types=1);\n+\n+namespace ZendPhpStan\\Type\\Zend;\n+\n+use PhpParser\\Node\\Expr\\MethodCall;\n+use PHPStan\\Analyser\\Scope;\n+use PHPStan\\Reflection\\MethodReflection;\n+use PHPStan\\Type\\Constant\\ConstantStringType;\n+use PHPStan\\Type\\MixedType;\n+use PHPStan\\Type\\NullType;\n+use PHPStan\\Type\\ObjectType;\n+use PHPStan\\Type\\Type;\n+use Zend\\ServiceManager\\ServiceManager;\n+\n+final class ServiceManagerGetDynamicReturnTypeExtension implements \\PHPStan\\Type\\DynamicMethodReturnTypeExtension\n+{\n+    /**\n+     * @var ServiceManagerLoader\n+     */\n+    private $serviceManagerLoader;\n+\n+    public function __construct(ServiceManagerLoader $serviceManagerLoader)\n+    {\n+        $this->serviceManagerLoader = $serviceManagerLoader;\n+    }\n+\n+    public function getClass(): string\n+    {\n+        return ServiceManager::class;\n+    }\n+\n+    public function isMethodSupported(MethodReflection $methodReflection): bool\n+    {\n+        return 'get' === $methodReflection->getName();\n+    }\n+\n+    public function getTypeFromMethodCall(\n+        MethodReflection $methodReflection,\n+        MethodCall $methodCall,\n+        Scope $scope\n+    ): Type {\n+        if (1 !== \\count($methodCall->args)) {\n+            return new MixedType();\n+        }\n+\n+        $argType = $scope->getType($methodCall->args[0]->value);\n+        if (! $argType instanceof ConstantStringType) {\n+            return new MixedType();\n+        }\n+\n+        $objectName     = $argType->getValue();\n+        $serviceManager = $this->serviceManagerLoader->getServiceManager();\n+        if (! $serviceManager->has($objectName)) {\n+            return new NullType();","path":"src/Type/Zend/ServiceManagerGetDynamicReturnTypeExtension.php","position":56,"original_position":56,"commit_id":"8286498d172c4b632f16625751bf8114a361dc3a","original_commit_id":"8286498d172c4b632f16625751bf8114a361dc3a","user":{"login":"ondrejmirtes","id":104888,"node_id":"MDQ6VXNlcjEwNDg4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/104888?v=4","gravatar_id":"","url":"https://api.github.com/users/ondrejmirtes","html_url":"https://github.com/ondrejmirtes","followers_url":"https://api.github.com/users/ondrejmirtes/followers","following_url":"https://api.github.com/users/ondrejmirtes/following{/other_user}","gists_url":"https://api.github.com/users/ondrejmirtes/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrejmirtes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrejmirtes/subscriptions","organizations_url":"https://api.github.com/users/ondrejmirtes/orgs","repos_url":"https://api.github.com/users/ondrejmirtes/repos","events_url":"https://api.github.com/users/ondrejmirtes/events{/privacy}","received_events_url":"https://api.github.com/users/ondrejmirtes/received_events","type":"User","site_admin":false},"body":"You need not to throw an exception from the extension, and you need to write a rule that checks for this situation.","created_at":"2019-06-04T09:23:02Z","updated_at":"2019-06-04T09:23:02Z","html_url":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1#discussion_r290204417","pull_request_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/comments/290204417"},"html":{"href":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1#discussion_r290204417"},"pull_request":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1"}},"in_reply_to_id":290201925},"pull_request":{"url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1","id":284878927,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg0ODc4OTI3","html_url":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1","diff_url":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1.diff","patch_url":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1.patch","issue_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/1","number":1,"state":"open","locked":false,"title":"PHPStan 0.11 and PluginManagers refactor","user":{"login":"Slamdunk","id":152236,"node_id":"MDQ6VXNlcjE1MjIzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"body":"Ref: https://github.com/bitwombat/phpstan-zend-framework/issues/3\r\n\r\n- [x] Support PHPStan 0.11\r\n- [x] Support custom ServiceManager injection\r\n- [x] Support main ServiceManager services\r\n- [ ] Support main ControllerManager services\r\n- [x] Support main ControllerPluginManager services\r\n- [ ] Support main ViewHelperManager services\r\n- [ ] Support main RoutePluginManager services\r\n\r\nSee [ModuleManagerFactory](https://github.com/zendframework/zend-mvc/blob/master/src/Service/ModuleManagerFactory.php)","created_at":"2019-06-04T09:03:54Z","updated_at":"2019-06-04T09:23:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/1/comments","statuses_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/statuses/8286498d172c4b632f16625751bf8114a361dc3a","head":{"label":"Slamdunk:refactor","ref":"refactor","sha":"8286498d172c4b632f16625751bf8114a361dc3a","user":{"login":"Slamdunk","id":152236,"node_id":"MDQ6VXNlcjE1MjIzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"repo":{"id":190143761,"node_id":"MDEwOlJlcG9zaXRvcnkxOTAxNDM3NjE=","name":"phpstan-zend-framework","full_name":"Slamdunk/phpstan-zend-framework","private":false,"owner":{"login":"Slamdunk","id":152236,"node_id":"MDQ6VXNlcjE1MjIzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Slamdunk/phpstan-zend-framework","description":"Zend Framework 3 extensions for PHPStan","fork":true,"url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework","forks_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/forks","keys_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/teams","hooks_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/hooks","issue_events_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/events{/number}","events_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/events","assignees_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/assignees{/user}","branches_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/branches{/branch}","tags_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/tags","blobs_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/languages","stargazers_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/stargazers","contributors_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/contributors","subscribers_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/subscribers","subscription_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/subscription","commits_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/contents/{+path}","compare_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/merges","archive_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/downloads","issues_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues{/number}","pulls_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/labels{/name}","releases_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/releases{/id}","deployments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/deployments","created_at":"2019-06-04T06:37:38Z","updated_at":"2019-06-04T06:37:40Z","pushed_at":"2019-06-04T09:03:54Z","git_url":"git://github.com/Slamdunk/phpstan-zend-framework.git","ssh_url":"git@github.com:Slamdunk/phpstan-zend-framework.git","clone_url":"https://github.com/Slamdunk/phpstan-zend-framework.git","svn_url":"https://github.com/Slamdunk/phpstan-zend-framework","homepage":"","size":15,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Slamdunk:master","ref":"master","sha":"3b8b4accce388ccdf233152aef1311649ae4f9dd","user":{"login":"Slamdunk","id":152236,"node_id":"MDQ6VXNlcjE1MjIzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"repo":{"id":190143761,"node_id":"MDEwOlJlcG9zaXRvcnkxOTAxNDM3NjE=","name":"phpstan-zend-framework","full_name":"Slamdunk/phpstan-zend-framework","private":false,"owner":{"login":"Slamdunk","id":152236,"node_id":"MDQ6VXNlcjE1MjIzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Slamdunk/phpstan-zend-framework","description":"Zend Framework 3 extensions for PHPStan","fork":true,"url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework","forks_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/forks","keys_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/teams","hooks_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/hooks","issue_events_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/events{/number}","events_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/events","assignees_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/assignees{/user}","branches_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/branches{/branch}","tags_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/tags","blobs_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/languages","stargazers_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/stargazers","contributors_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/contributors","subscribers_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/subscribers","subscription_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/subscription","commits_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/contents/{+path}","compare_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/merges","archive_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/downloads","issues_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues{/number}","pulls_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/labels{/name}","releases_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/releases{/id}","deployments_url":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/deployments","created_at":"2019-06-04T06:37:38Z","updated_at":"2019-06-04T06:37:40Z","pushed_at":"2019-06-04T09:03:54Z","git_url":"git://github.com/Slamdunk/phpstan-zend-framework.git","ssh_url":"git@github.com:Slamdunk/phpstan-zend-framework.git","clone_url":"https://github.com/Slamdunk/phpstan-zend-framework.git","svn_url":"https://github.com/Slamdunk/phpstan-zend-framework","homepage":"","size":15,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1"},"html":{"href":"https://github.com/Slamdunk/phpstan-zend-framework/pull/1"},"issue":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/1"},"comments":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Slamdunk/phpstan-zend-framework/statuses/8286498d172c4b632f16625751bf8114a361dc3a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ondrejmirtes"}}