{"action":"created","comment":{"url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/comments/54422393","id":54422393,"diff_hunk":"@@ -0,0 +1,85 @@\n+<?php\n+\n+namespace Http\\HttplugBundle\\DependencyInjection\\Compiler;\n+\n+use Http\\Client\\HttpClient;\n+use Http\\HttplugBundle\\Util\\HttplugFactory;\n+use Http\\Message\\MessageFactory;\n+use Http\\Message\\StreamFactory;\n+use Http\\Message\\UriFactory;\n+use Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface;\n+use Symfony\\Component\\DependencyInjection\\ContainerBuilder;\n+use Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException;\n+use Symfony\\Component\\DependencyInjection\\Reference;\n+\n+/**\n+ * Adds fallback and discovery services.\n+ *\n+ * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>\n+ */\n+final class DiscoveryPass implements CompilerPassInterface\n+{\n+    /**\n+     * Fallback services and classes.\n+     *\n+     * @var array\n+     */\n+    private $services = [\n+        'client' => HttpClient::class,\n+        'message_factory' => MessageFactory::class,\n+        'uri_factory' => UriFactory::class,\n+        'stream_factory' => StreamFactory::class,\n+    ];\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function process(ContainerBuilder $container)\n+    {\n+        $useDiscovery = false;\n+\n+        foreach ($this->services as $service => $class) {\n+            $serviceId = sprintf('httplug.%s.default', $service);\n+\n+            if (false === $container->has($serviceId)) {\n+                // Register and create factory for the first time\n+                if (false === $useDiscovery) {","path":"DependencyInjection/Compiler/DiscoveryPass.php","position":46,"original_position":46,"commit_id":"99918960080ece6bba8ee1f6af7466cea322d4c8","original_commit_id":"99918960080ece6bba8ee1f6af7466cea322d4c8","user":{"login":"Nyholm","id":1275206,"avatar_url":"https://avatars.githubusercontent.com/u/1275206?v=3","gravatar_id":"","url":"https://api.github.com/users/Nyholm","html_url":"https://github.com/Nyholm","followers_url":"https://api.github.com/users/Nyholm/followers","following_url":"https://api.github.com/users/Nyholm/following{/other_user}","gists_url":"https://api.github.com/users/Nyholm/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyholm/subscriptions","organizations_url":"https://api.github.com/users/Nyholm/orgs","repos_url":"https://api.github.com/users/Nyholm/repos","events_url":"https://api.github.com/users/Nyholm/events{/privacy}","received_events_url":"https://api.github.com/users/Nyholm/received_events","type":"User","site_admin":false},"body":"No, the `$factory` is a \"httplug.factory\". A service that works as a factory class for our *Factory classes. (MessageFactory, ClientFactory etc.. )\r\n\r\n","created_at":"2016-02-29T15:16:20Z","updated_at":"2016-02-29T15:16:20Z","html_url":"https://github.com/php-http/HttplugBundle/pull/55#discussion_r54422393","pull_request_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/comments/54422393"},"html":{"href":"https://github.com/php-http/HttplugBundle/pull/55#discussion_r54422393"},"pull_request":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55","id":61049482,"html_url":"https://github.com/php-http/HttplugBundle/pull/55","diff_url":"https://github.com/php-http/HttplugBundle/pull/55.diff","patch_url":"https://github.com/php-http/HttplugBundle/pull/55.patch","issue_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/55","number":55,"state":"open","locked":false,"title":"[WIP] Remove discovery dependency","user":{"login":"sagikazarmark","id":1226384,"avatar_url":"https://avatars.githubusercontent.com/u/1226384?v=3","gravatar_id":"","url":"https://api.github.com/users/sagikazarmark","html_url":"https://github.com/sagikazarmark","followers_url":"https://api.github.com/users/sagikazarmark/followers","following_url":"https://api.github.com/users/sagikazarmark/following{/other_user}","gists_url":"https://api.github.com/users/sagikazarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/sagikazarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagikazarmark/subscriptions","organizations_url":"https://api.github.com/users/sagikazarmark/orgs","repos_url":"https://api.github.com/users/sagikazarmark/repos","events_url":"https://api.github.com/users/sagikazarmark/events{/privacy}","received_events_url":"https://api.github.com/users/sagikazarmark/received_events","type":"User","site_admin":false},"body":"Includes #54 \r\nUnfortunately I couldn't fix functional tests, although I added the symfony bundle to the test AppKernel.\r\n\r\nAny ideas?","created_at":"2016-02-29T09:31:21Z","updated_at":"2016-02-29T15:16:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88ca358bdb464245457e4889253428ed5f8ef8e7","assignee":null,"milestone":{"url":"https://api.github.com/repos/php-http/HttplugBundle/milestones/1","html_url":"https://github.com/php-http/HttplugBundle/milestones/1.0.0","labels_url":"https://api.github.com/repos/php-http/HttplugBundle/milestones/1/labels","id":1550779,"number":1,"title":"1.0.0","description":"","creator":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=3","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2016-01-29T08:19:24Z","updated_at":"2016-02-29T09:31:21Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55/commits","review_comments_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55/comments","review_comment_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/55/comments","statuses_url":"https://api.github.com/repos/php-http/HttplugBundle/statuses/99918960080ece6bba8ee1f6af7466cea322d4c8","head":{"label":"php-http:httplug_factory","ref":"httplug_factory","sha":"99918960080ece6bba8ee1f6af7466cea322d4c8","user":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":41299142,"name":"HttplugBundle","full_name":"php-http/HttplugBundle","owner":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-http/HttplugBundle","description":"Symfony Framework Integration for HTTPlug","fork":false,"url":"https://api.github.com/repos/php-http/HttplugBundle","forks_url":"https://api.github.com/repos/php-http/HttplugBundle/forks","keys_url":"https://api.github.com/repos/php-http/HttplugBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/HttplugBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/HttplugBundle/teams","hooks_url":"https://api.github.com/repos/php-http/HttplugBundle/hooks","issue_events_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/HttplugBundle/events","assignees_url":"https://api.github.com/repos/php-http/HttplugBundle/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/HttplugBundle/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/HttplugBundle/tags","blobs_url":"https://api.github.com/repos/php-http/HttplugBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/HttplugBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/HttplugBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/HttplugBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/HttplugBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/HttplugBundle/languages","stargazers_url":"https://api.github.com/repos/php-http/HttplugBundle/stargazers","contributors_url":"https://api.github.com/repos/php-http/HttplugBundle/contributors","subscribers_url":"https://api.github.com/repos/php-http/HttplugBundle/subscribers","subscription_url":"https://api.github.com/repos/php-http/HttplugBundle/subscription","commits_url":"https://api.github.com/repos/php-http/HttplugBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/HttplugBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/HttplugBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/HttplugBundle/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/HttplugBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/HttplugBundle/merges","archive_url":"https://api.github.com/repos/php-http/HttplugBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/HttplugBundle/downloads","issues_url":"https://api.github.com/repos/php-http/HttplugBundle/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/HttplugBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/HttplugBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/HttplugBundle/labels{/name}","releases_url":"https://api.github.com/repos/php-http/HttplugBundle/releases{/id}","deployments_url":"https://api.github.com/repos/php-http/HttplugBundle/deployments","created_at":"2015-08-24T11:22:40Z","updated_at":"2016-02-22T17:49:12Z","pushed_at":"2016-02-29T14:11:13Z","git_url":"git://github.com/php-http/HttplugBundle.git","ssh_url":"git@github.com:php-http/HttplugBundle.git","clone_url":"https://github.com/php-http/HttplugBundle.git","svn_url":"https://github.com/php-http/HttplugBundle","homepage":"http://httplug.io","size":82,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":8,"default_branch":"master"}},"base":{"label":"php-http:master","ref":"master","sha":"be79e504d773ab4f42901fd6d6cd13c46a3f7a1b","user":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":41299142,"name":"HttplugBundle","full_name":"php-http/HttplugBundle","owner":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-http/HttplugBundle","description":"Symfony Framework Integration for HTTPlug","fork":false,"url":"https://api.github.com/repos/php-http/HttplugBundle","forks_url":"https://api.github.com/repos/php-http/HttplugBundle/forks","keys_url":"https://api.github.com/repos/php-http/HttplugBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/HttplugBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/HttplugBundle/teams","hooks_url":"https://api.github.com/repos/php-http/HttplugBundle/hooks","issue_events_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/HttplugBundle/events","assignees_url":"https://api.github.com/repos/php-http/HttplugBundle/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/HttplugBundle/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/HttplugBundle/tags","blobs_url":"https://api.github.com/repos/php-http/HttplugBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/HttplugBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/HttplugBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/HttplugBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/HttplugBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/HttplugBundle/languages","stargazers_url":"https://api.github.com/repos/php-http/HttplugBundle/stargazers","contributors_url":"https://api.github.com/repos/php-http/HttplugBundle/contributors","subscribers_url":"https://api.github.com/repos/php-http/HttplugBundle/subscribers","subscription_url":"https://api.github.com/repos/php-http/HttplugBundle/subscription","commits_url":"https://api.github.com/repos/php-http/HttplugBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/HttplugBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/HttplugBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/HttplugBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/HttplugBundle/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/HttplugBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/HttplugBundle/merges","archive_url":"https://api.github.com/repos/php-http/HttplugBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/HttplugBundle/downloads","issues_url":"https://api.github.com/repos/php-http/HttplugBundle/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/HttplugBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/HttplugBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/HttplugBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/HttplugBundle/labels{/name}","releases_url":"https://api.github.com/repos/php-http/HttplugBundle/releases{/id}","deployments_url":"https://api.github.com/repos/php-http/HttplugBundle/deployments","created_at":"2015-08-24T11:22:40Z","updated_at":"2016-02-22T17:49:12Z","pushed_at":"2016-02-29T14:11:13Z","git_url":"git://github.com/php-http/HttplugBundle.git","ssh_url":"git@github.com:php-http/HttplugBundle.git","clone_url":"https://github.com/php-http/HttplugBundle.git","svn_url":"https://github.com/php-http/HttplugBundle","homepage":"http://httplug.io","size":82,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55"},"html":{"href":"https://github.com/php-http/HttplugBundle/pull/55"},"issue":{"href":"https://api.github.com/repos/php-http/HttplugBundle/issues/55"},"comments":{"href":"https://api.github.com/repos/php-http/HttplugBundle/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-http/HttplugBundle/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/php-http/HttplugBundle/statuses/99918960080ece6bba8ee1f6af7466cea322d4c8"}}}}