{"action":"created","comment":{"url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/comments/42474500","id":42474500,"diff_hunk":"@@ -0,0 +1,131 @@\n+<?php\n+\n+/*\n+ * This file is part of the CsaGuzzleBundle package\n+ *\n+ * (c) Charles Sarrazin <charles@sarraz.in>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code\n+ */\n+\n+namespace Csa\\Bundle\\GuzzleBundle\\GuzzleHttp;\n+\n+use GuzzleHttp\\Client;\n+use GuzzleHttp\\Psr7;\n+use Psr\\Http\\Message\\RequestInterface;\n+\n+class ClientSerializerAdapter extends Client\n+{\n+    /**\n+     * @param RequestInterface $request\n+     * @param array $options\n+     *\n+     * @return mixed\n+     */\n+    public function sendAsync(RequestInterface $request, array $options = [])\n+    {\n+        $options = $this->prepareDefaults($options);\n+        $response = parent::sendAsync($request, $options)->wait();\n+\n+        return $this->processResponse($response, $options);\n+    }\n+\n+    /**\n+     * @param string $method\n+     * @param null|string $uri\n+     * @param array $options\n+     *\n+     * @return mixed\n+     */\n+    public function requestAsync($method, $uri = null, array $options = [])\n+    {\n+        $options = $this->prepareDefaults($options);\n+        $response = parent::requestAsync($method, $uri, $options)->wait();\n+\n+        return $this->processResponse($response, $options);\n+    }\n+\n+    /**\n+     * Hook into the defaults options that cannot be changed by middleware.\n+     *\n+     * @param array $options\n+     *\n+     * @return array\n+     */\n+    private function prepareDefaults(array $options = [])\n+    {\n+        $serializerAdapter = $this->getConfig('serializer_adapter');\n+\n+        if ((isset($options['json'])) && $serializerAdapter) {\n+            $modify['body'] = Psr7\\stream_for($serializerAdapter->serialize(","path":"src/GuzzleHttp/ClientSerializerAdapter.php","position":61,"original_position":61,"commit_id":"4a9876c8e90e56c79ff8771763e826d68d7914e5","original_commit_id":"4a9876c8e90e56c79ff8771763e826d68d7914e5","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"body":"This won't work for Guzzle 4 or 5. I guess I'll cherry-pick your commits to merge them into `1.3`, and then into `master`. Ok ? :)","created_at":"2015-10-20T09:40:08Z","updated_at":"2015-10-20T09:40:08Z","html_url":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70#discussion_r42474500","pull_request_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/comments/42474500"},"html":{"href":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70#discussion_r42474500"},"pull_request":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70","id":48172772,"html_url":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70","diff_url":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70.diff","patch_url":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70.patch","issue_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/70","number":70,"state":"open","locked":false,"title":"[WIP] Add a serializer support","user":{"login":"florianbelhomme","id":4208880,"avatar_url":"https://avatars.githubusercontent.com/u/4208880?v=3","gravatar_id":"","url":"https://api.github.com/users/florianbelhomme","html_url":"https://github.com/florianbelhomme","followers_url":"https://api.github.com/users/florianbelhomme/followers","following_url":"https://api.github.com/users/florianbelhomme/following{/other_user}","gists_url":"https://api.github.com/users/florianbelhomme/gists{/gist_id}","starred_url":"https://api.github.com/users/florianbelhomme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianbelhomme/subscriptions","organizations_url":"https://api.github.com/users/florianbelhomme/orgs","repos_url":"https://api.github.com/users/florianbelhomme/repos","events_url":"https://api.github.com/users/florianbelhomme/events{/privacy}","received_events_url":"https://api.github.com/users/florianbelhomme/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-20T08:57:26Z","updated_at":"2015-10-20T09:40:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4955f26d02cc3caff05a2163bbdd2d95bcab50a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70/commits","review_comments_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70/comments","review_comment_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/70/comments","statuses_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/statuses/4a9876c8e90e56c79ff8771763e826d68d7914e5","head":{"label":"florianbelhomme:serializeradapter","ref":"serializeradapter","sha":"4a9876c8e90e56c79ff8771763e826d68d7914e5","user":{"login":"florianbelhomme","id":4208880,"avatar_url":"https://avatars.githubusercontent.com/u/4208880?v=3","gravatar_id":"","url":"https://api.github.com/users/florianbelhomme","html_url":"https://github.com/florianbelhomme","followers_url":"https://api.github.com/users/florianbelhomme/followers","following_url":"https://api.github.com/users/florianbelhomme/following{/other_user}","gists_url":"https://api.github.com/users/florianbelhomme/gists{/gist_id}","starred_url":"https://api.github.com/users/florianbelhomme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianbelhomme/subscriptions","organizations_url":"https://api.github.com/users/florianbelhomme/orgs","repos_url":"https://api.github.com/users/florianbelhomme/repos","events_url":"https://api.github.com/users/florianbelhomme/events{/privacy}","received_events_url":"https://api.github.com/users/florianbelhomme/received_events","type":"User","site_admin":false},"repo":{"id":44232824,"name":"CsaGuzzleBundle","full_name":"florianbelhomme/CsaGuzzleBundle","owner":{"login":"florianbelhomme","id":4208880,"avatar_url":"https://avatars.githubusercontent.com/u/4208880?v=3","gravatar_id":"","url":"https://api.github.com/users/florianbelhomme","html_url":"https://github.com/florianbelhomme","followers_url":"https://api.github.com/users/florianbelhomme/followers","following_url":"https://api.github.com/users/florianbelhomme/following{/other_user}","gists_url":"https://api.github.com/users/florianbelhomme/gists{/gist_id}","starred_url":"https://api.github.com/users/florianbelhomme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianbelhomme/subscriptions","organizations_url":"https://api.github.com/users/florianbelhomme/orgs","repos_url":"https://api.github.com/users/florianbelhomme/repos","events_url":"https://api.github.com/users/florianbelhomme/events{/privacy}","received_events_url":"https://api.github.com/users/florianbelhomme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florianbelhomme/CsaGuzzleBundle","description":"A bundle integrating Guzzle >=4.0 in Symfony","fork":true,"url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle","forks_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/forks","keys_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/teams","hooks_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/hooks","issue_events_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/issues/events{/number}","events_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/events","assignees_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/assignees{/user}","branches_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/branches{/branch}","tags_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/tags","blobs_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/languages","stargazers_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/stargazers","contributors_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/contributors","subscribers_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/subscribers","subscription_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/subscription","commits_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/contents/{+path}","compare_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/merges","archive_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/downloads","issues_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/issues{/number}","pulls_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/labels{/name}","releases_url":"https://api.github.com/repos/florianbelhomme/CsaGuzzleBundle/releases{/id}","created_at":"2015-10-14T07:58:59Z","updated_at":"2015-10-14T07:58:59Z","pushed_at":"2015-10-20T09:36:48Z","git_url":"git://github.com/florianbelhomme/CsaGuzzleBundle.git","ssh_url":"git@github.com:florianbelhomme/CsaGuzzleBundle.git","clone_url":"https://github.com/florianbelhomme/CsaGuzzleBundle.git","svn_url":"https://github.com/florianbelhomme/CsaGuzzleBundle","homepage":"","size":1747,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"csarrazi:master","ref":"master","sha":"2a154e388624bbf639033cd4a39055c5385069d2","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"repo":{"id":18691924,"name":"CsaGuzzleBundle","full_name":"csarrazi/CsaGuzzleBundle","owner":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csarrazi/CsaGuzzleBundle","description":"A bundle integrating Guzzle >=4.0 in Symfony","fork":false,"url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle","forks_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/forks","keys_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/teams","hooks_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/hooks","issue_events_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/events{/number}","events_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/events","assignees_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/assignees{/user}","branches_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/branches{/branch}","tags_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/tags","blobs_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/languages","stargazers_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/stargazers","contributors_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/contributors","subscribers_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/subscribers","subscription_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/subscription","commits_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/contents/{+path}","compare_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/merges","archive_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/downloads","issues_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues{/number}","pulls_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/labels{/name}","releases_url":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/releases{/id}","created_at":"2014-04-11T23:45:04Z","updated_at":"2015-10-11T15:22:53Z","pushed_at":"2015-10-20T09:36:49Z","git_url":"git://github.com/csarrazi/CsaGuzzleBundle.git","ssh_url":"git@github.com:csarrazi/CsaGuzzleBundle.git","clone_url":"https://github.com/csarrazi/CsaGuzzleBundle.git","svn_url":"https://github.com/csarrazi/CsaGuzzleBundle","homepage":"","size":1541,"stargazers_count":47,"watchers_count":47,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":6,"forks":19,"open_issues":6,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70"},"html":{"href":"https://github.com/csarrazi/CsaGuzzleBundle/pull/70"},"issue":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/70"},"comments":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/csarrazi/CsaGuzzleBundle/statuses/4a9876c8e90e56c79ff8771763e826d68d7914e5"}}}}