{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-feed/pulls/comments/45259379","id":45259379,"diff_hunk":"@@ -371,9 +377,8 @@ public static function importFile($filename)\n      */\n     public static function findFeedLinks($uri)\n     {\n-        $client = static::getHttpClient();\n-        $client->setUri($uri);\n-        $response = $client->send();\n+        $client   = static::getHttpClient();\n+        $response = $client->get($uri);","path":"src/Reader/Reader.php","position":146,"original_position":146,"commit_id":"33f50f058d5acd430498f1e8f7fa3d9456ae11e8","original_commit_id":"33f50f058d5acd430498f1e8f7fa3d9456ae11e8","user":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"body":"Unsafe use of `HeaderAwareClientInterface::get`","created_at":"2015-11-18T21:01:16Z","updated_at":"2015-11-18T21:01:16Z","html_url":"https://github.com/zendframework/zend-feed/pull/14#discussion_r45259379","pull_request_url":"https://api.github.com/repos/zendframework/zend-feed/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/comments/45259379"},"html":{"href":"https://github.com/zendframework/zend-feed/pull/14#discussion_r45259379"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-feed/pulls/14","id":50569728,"html_url":"https://github.com/zendframework/zend-feed/pull/14","diff_url":"https://github.com/zendframework/zend-feed/pull/14.diff","patch_url":"https://github.com/zendframework/zend-feed/pull/14.patch","issue_url":"https://api.github.com/repos/zendframework/zend-feed/issues/14","number":14,"state":"open","locked":false,"title":"Fully separate HTTP client requirements","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"This patch extends from and builds on #8 to allow for any `Zend\\Feed\\Reader\\Http\\ClientInterface` implementations to work for `Zend\\Feed\\Reader\\Reader` operations that need an HTTP client. To make this happen, it does the following:\n\n- Adds `Zend\\Feed\\Reader\\Http\\HeaderAwareClientInterface`, which defines the `get()` method with an additional, optional argument, `array $headers = []`. This allows passing the `If-*` headers used for testing HTTP caching.\n- Adds `Zend\\Feed\\Reader\\Http\\HeaderAwareResponseInterface`, which extends the `ResponseInterface` to add a `getHeader($name, $default = null)` method; this, too, is used in situations where using HTTP cache headers.\n- Adds `Zend\\Feed\\Reader\\Http\\Response`, an implementation of `HeaderAwareResponseInterface`. Its constructor accepts the status code, body, and optionally headers and validates and normalizes them.\n- Adds `Zend\\Feed\\Reader\\Http\\ZendHttpClientDecorator`, an implementation of `ClientInterface` that decorates a zend-http client instance, and ensures a properly seeded `HeaderAwareResponseInterface` instance is returned.\n- Updates `Zend\\Feed\\Reader\\Reader::setHttpClient()` to decorate instances of `Zend\\Http\\Client` using the `ZendHttpClientDecorator`.\n- Updates `Zend\\Feed\\Reader\\Reader::getHttpClient()` to lazy-load a zend-http client and decorate it using `ZendHttpClientDecorator` if no instance is currently attached.\n- Updates `Zend\\Feed\\Reader\\Reader::import()` to use a `ClientInterface` instance. Internally, it also checks to see if that instance implements `HeaderAwareClientInterface` in order to provide headers when fetching a feed, and checks the returned response against `HeaderAwareResponseInterface` in order to fetch headers when HTTP cache checks are necessary.\n- Updates `Zend\\Feed\\Reader\\Reader::findFeedLinks()` to use only methods defined in `ClientInterface`.\n\nThe only test changes necessary were:\n\n- Updating `testSetHttpClient()` to use a mock `ClientInterface` and test for identity.\n- Adding the method `testSetHttpClientWillDecorateAZendHttpClientInstance()` to ensure that passing a zend-http client to `setHttpClient()` decorates it with `ZendHttpClientDecorator`.\n\nThe latter test ensures that the changes are backwards compatible.\n\nThis feature remains backwards compatible with previous versions, but should target the next minor release (2.6.0).","created_at":"2015-11-12T21:22:58Z","updated_at":"2015-11-18T21:01:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b83122807e46794c662aecd50e6647fc74a7e0d2","assignee":null,"milestone":{"url":"https://api.github.com/repos/zendframework/zend-feed/milestones/5","html_url":"https://github.com/zendframework/zend-feed/milestones/2.6.0","labels_url":"https://api.github.com/repos/zendframework/zend-feed/milestones/5/labels","id":1148979,"number":5,"title":"2.6.0","description":"next feature release","creator":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2015-06-04T07:32:40Z","updated_at":"2015-11-12T21:23:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/zendframework/zend-feed/pulls/14/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-feed/pulls/14/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-feed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-feed/issues/14/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-feed/statuses/33f50f058d5acd430498f1e8f7fa3d9456ae11e8","head":{"label":"weierophinney:feature/8","ref":"feature/8","sha":"33f50f058d5acd430498f1e8f7fa3d9456ae11e8","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"repo":{"id":45934251,"name":"zend-feed","full_name":"weierophinney/zend-feed","owner":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weierophinney/zend-feed","description":"Feed component from Zend Framework","fork":true,"url":"https://api.github.com/repos/weierophinney/zend-feed","forks_url":"https://api.github.com/repos/weierophinney/zend-feed/forks","keys_url":"https://api.github.com/repos/weierophinney/zend-feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weierophinney/zend-feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weierophinney/zend-feed/teams","hooks_url":"https://api.github.com/repos/weierophinney/zend-feed/hooks","issue_events_url":"https://api.github.com/repos/weierophinney/zend-feed/issues/events{/number}","events_url":"https://api.github.com/repos/weierophinney/zend-feed/events","assignees_url":"https://api.github.com/repos/weierophinney/zend-feed/assignees{/user}","branches_url":"https://api.github.com/repos/weierophinney/zend-feed/branches{/branch}","tags_url":"https://api.github.com/repos/weierophinney/zend-feed/tags","blobs_url":"https://api.github.com/repos/weierophinney/zend-feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weierophinney/zend-feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weierophinney/zend-feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/weierophinney/zend-feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weierophinney/zend-feed/statuses/{sha}","languages_url":"https://api.github.com/repos/weierophinney/zend-feed/languages","stargazers_url":"https://api.github.com/repos/weierophinney/zend-feed/stargazers","contributors_url":"https://api.github.com/repos/weierophinney/zend-feed/contributors","subscribers_url":"https://api.github.com/repos/weierophinney/zend-feed/subscribers","subscription_url":"https://api.github.com/repos/weierophinney/zend-feed/subscription","commits_url":"https://api.github.com/repos/weierophinney/zend-feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/weierophinney/zend-feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/weierophinney/zend-feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/weierophinney/zend-feed/issues/comments{/number}","contents_url":"https://api.github.com/repos/weierophinney/zend-feed/contents/{+path}","compare_url":"https://api.github.com/repos/weierophinney/zend-feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weierophinney/zend-feed/merges","archive_url":"https://api.github.com/repos/weierophinney/zend-feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weierophinney/zend-feed/downloads","issues_url":"https://api.github.com/repos/weierophinney/zend-feed/issues{/number}","pulls_url":"https://api.github.com/repos/weierophinney/zend-feed/pulls{/number}","milestones_url":"https://api.github.com/repos/weierophinney/zend-feed/milestones{/number}","notifications_url":"https://api.github.com/repos/weierophinney/zend-feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weierophinney/zend-feed/labels{/name}","releases_url":"https://api.github.com/repos/weierophinney/zend-feed/releases{/id}","created_at":"2015-11-10T19:11:41Z","updated_at":"2015-11-10T19:11:43Z","pushed_at":"2015-11-17T19:38:52Z","git_url":"git://github.com/weierophinney/zend-feed.git","ssh_url":"git@github.com:weierophinney/zend-feed.git","clone_url":"https://github.com/weierophinney/zend-feed.git","svn_url":"https://github.com/weierophinney/zend-feed","homepage":"https://github.com/zendframework/zf2","size":3685,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zendframework:develop","ref":"develop","sha":"878f1d0a6f69cffea7e71f1acbf7a29771c30489","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35280800,"name":"zend-feed","full_name":"zendframework/zend-feed","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-feed","description":"Feed component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-feed","forks_url":"https://api.github.com/repos/zendframework/zend-feed/forks","keys_url":"https://api.github.com/repos/zendframework/zend-feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-feed/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-feed/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-feed/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-feed/events","assignees_url":"https://api.github.com/repos/zendframework/zend-feed/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-feed/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-feed/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-feed/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-feed/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-feed/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-feed/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-feed/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-feed/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-feed/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-feed/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-feed/merges","archive_url":"https://api.github.com/repos/zendframework/zend-feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-feed/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-feed/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-feed/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-feed/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-feed/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-feed/releases{/id}","created_at":"2015-05-08T13:27:58Z","updated_at":"2015-11-11T01:47:21Z","pushed_at":"2015-11-17T19:38:52Z","git_url":"git://github.com/zendframework/zend-feed.git","ssh_url":"git@github.com:zendframework/zend-feed.git","clone_url":"https://github.com/zendframework/zend-feed.git","svn_url":"https://github.com/zendframework/zend-feed","homepage":"https://github.com/zendframework/zf2","size":4023,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":3,"forks":13,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/14"},"html":{"href":"https://github.com/zendframework/zend-feed/pull/14"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-feed/issues/14"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-feed/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-feed/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-feed/statuses/33f50f058d5acd430498f1e8f7fa3d9456ae11e8"}}}}