{"action":"created","comment":{"url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/comments/41405201","id":41405201,"diff_hunk":"@@ -275,26 +276,33 @@ public function wait_content()\n         return $msg;\n     }\n \n-    protected function build_msg_body($body_size) {\n+    /**\n+     * Reads and set the given message body by taking care of the possible message\n+     * body size limit.\n+     *\n+     * @param \\PhpAmqpLib\\Message\\AMQPMessage $message\n+     */\n+    protected function buildMessageBody($message)\n+    {\n         $body_parts = array();\n         $body_received = 0;\n-        $is_truncated = false;\n-        while (bccomp($body_size, $body_received, 0) == 1) {\n+\n+        while (bccomp($message->getBodySize(), $body_received, 0) == 1) {\n             list($frame_type, $payload) = $this->next_frame();\n \n             $this->validate_body_frame($frame_type);\n \n             $body_received = bcadd($body_received, mb_strlen($payload, 'ASCII'), 0);\n \n-            if ( ! is_null($this->body_size_max) && $body_received > $this->body_size_max ) {\n-                $is_truncated = true;\n+            if (is_int($this->maxBodySize) && $body_received > $this->maxBodySize ) {\n+                $message->setIsTruncated(true);\n                 continue;\n             }\n \n             $body_parts[] = $payload;\n         }\n \n-        return array(implode('', $body_parts), $is_truncated);\n+        $message->setBody(implode('', $body_parts));","path":"PhpAmqpLib/Channel/AbstractChannel.php","position":null,"original_position":108,"commit_id":"04d168bcf210d14b7b936db2304bb9b3c7039ab6","original_commit_id":"61dc25e53d5ebf04f5bff21aa8f1bfb3a5989bd2","user":{"login":"eexit","id":57098,"avatar_url":"https://avatars.githubusercontent.com/u/57098?v=3","gravatar_id":"","url":"https://api.github.com/users/eexit","html_url":"https://github.com/eexit","followers_url":"https://api.github.com/users/eexit/followers","following_url":"https://api.github.com/users/eexit/following{/other_user}","gists_url":"https://api.github.com/users/eexit/gists{/gist_id}","starred_url":"https://api.github.com/users/eexit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eexit/subscriptions","organizations_url":"https://api.github.com/users/eexit/orgs","repos_url":"https://api.github.com/users/eexit/repos","events_url":"https://api.github.com/users/eexit/events{/privacy}","received_events_url":"https://api.github.com/users/eexit/received_events","type":"User","site_admin":false},"body":"I updated the code.","created_at":"2015-10-07T15:33:01Z","updated_at":"2015-10-07T15:33:01Z","html_url":"https://github.com/videlalvaro/php-amqplib/pull/201#discussion_r41405201","pull_request_url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201","_links":{"self":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/comments/41405201"},"html":{"href":"https://github.com/videlalvaro/php-amqplib/pull/201#discussion_r41405201"},"pull_request":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201"}}},"pull_request":{"url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201","id":21553085,"html_url":"https://github.com/videlalvaro/php-amqplib/pull/201","diff_url":"https://github.com/videlalvaro/php-amqplib/pull/201.diff","patch_url":"https://github.com/videlalvaro/php-amqplib/pull/201.patch","issue_url":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/201","number":201,"state":"open","locked":false,"title":"Minor complexity optimizations + code organization","user":{"login":"eexit","id":57098,"avatar_url":"https://avatars.githubusercontent.com/u/57098?v=3","gravatar_id":"","url":"https://api.github.com/users/eexit","html_url":"https://github.com/eexit","followers_url":"https://api.github.com/users/eexit/followers","following_url":"https://api.github.com/users/eexit/following{/other_user}","gists_url":"https://api.github.com/users/eexit/gists{/gist_id}","starred_url":"https://api.github.com/users/eexit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eexit/subscriptions","organizations_url":"https://api.github.com/users/eexit/orgs","repos_url":"https://api.github.com/users/eexit/repos","events_url":"https://api.github.com/users/eexit/events{/privacy}","received_events_url":"https://api.github.com/users/eexit/received_events","type":"User","site_admin":false},"body":"According to #193, here's the PR that refacto some parts of the lib: condition simplifications, better variable naming, better exception message building, etc.\r\n\r\nFeedback and contribution is very welcomed.\r\n\r\nThanks,","created_at":"2014-09-21T21:56:10Z","updated_at":"2015-10-07T15:33:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"927c050cf9e344c09be001faeffc27b60ef21f5e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201/commits","review_comments_url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201/comments","review_comment_url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/201/comments","statuses_url":"https://api.github.com/repos/videlalvaro/php-amqplib/statuses/04d168bcf210d14b7b936db2304bb9b3c7039ab6","head":{"label":"eexit:minor-refacto","ref":"minor-refacto","sha":"04d168bcf210d14b7b936db2304bb9b3c7039ab6","user":{"login":"eexit","id":57098,"avatar_url":"https://avatars.githubusercontent.com/u/57098?v=3","gravatar_id":"","url":"https://api.github.com/users/eexit","html_url":"https://github.com/eexit","followers_url":"https://api.github.com/users/eexit/followers","following_url":"https://api.github.com/users/eexit/following{/other_user}","gists_url":"https://api.github.com/users/eexit/gists{/gist_id}","starred_url":"https://api.github.com/users/eexit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eexit/subscriptions","organizations_url":"https://api.github.com/users/eexit/orgs","repos_url":"https://api.github.com/users/eexit/repos","events_url":"https://api.github.com/users/eexit/events{/privacy}","received_events_url":"https://api.github.com/users/eexit/received_events","type":"User","site_admin":false},"repo":{"id":22924475,"name":"php-amqplib","full_name":"eexit/php-amqplib","owner":{"login":"eexit","id":57098,"avatar_url":"https://avatars.githubusercontent.com/u/57098?v=3","gravatar_id":"","url":"https://api.github.com/users/eexit","html_url":"https://github.com/eexit","followers_url":"https://api.github.com/users/eexit/followers","following_url":"https://api.github.com/users/eexit/following{/other_user}","gists_url":"https://api.github.com/users/eexit/gists{/gist_id}","starred_url":"https://api.github.com/users/eexit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eexit/subscriptions","organizations_url":"https://api.github.com/users/eexit/orgs","repos_url":"https://api.github.com/users/eexit/repos","events_url":"https://api.github.com/users/eexit/events{/privacy}","received_events_url":"https://api.github.com/users/eexit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eexit/php-amqplib","description":"AMQP library for PHP","fork":true,"url":"https://api.github.com/repos/eexit/php-amqplib","forks_url":"https://api.github.com/repos/eexit/php-amqplib/forks","keys_url":"https://api.github.com/repos/eexit/php-amqplib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eexit/php-amqplib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eexit/php-amqplib/teams","hooks_url":"https://api.github.com/repos/eexit/php-amqplib/hooks","issue_events_url":"https://api.github.com/repos/eexit/php-amqplib/issues/events{/number}","events_url":"https://api.github.com/repos/eexit/php-amqplib/events","assignees_url":"https://api.github.com/repos/eexit/php-amqplib/assignees{/user}","branches_url":"https://api.github.com/repos/eexit/php-amqplib/branches{/branch}","tags_url":"https://api.github.com/repos/eexit/php-amqplib/tags","blobs_url":"https://api.github.com/repos/eexit/php-amqplib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eexit/php-amqplib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eexit/php-amqplib/git/refs{/sha}","trees_url":"https://api.github.com/repos/eexit/php-amqplib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eexit/php-amqplib/statuses/{sha}","languages_url":"https://api.github.com/repos/eexit/php-amqplib/languages","stargazers_url":"https://api.github.com/repos/eexit/php-amqplib/stargazers","contributors_url":"https://api.github.com/repos/eexit/php-amqplib/contributors","subscribers_url":"https://api.github.com/repos/eexit/php-amqplib/subscribers","subscription_url":"https://api.github.com/repos/eexit/php-amqplib/subscription","commits_url":"https://api.github.com/repos/eexit/php-amqplib/commits{/sha}","git_commits_url":"https://api.github.com/repos/eexit/php-amqplib/git/commits{/sha}","comments_url":"https://api.github.com/repos/eexit/php-amqplib/comments{/number}","issue_comment_url":"https://api.github.com/repos/eexit/php-amqplib/issues/comments{/number}","contents_url":"https://api.github.com/repos/eexit/php-amqplib/contents/{+path}","compare_url":"https://api.github.com/repos/eexit/php-amqplib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eexit/php-amqplib/merges","archive_url":"https://api.github.com/repos/eexit/php-amqplib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eexit/php-amqplib/downloads","issues_url":"https://api.github.com/repos/eexit/php-amqplib/issues{/number}","pulls_url":"https://api.github.com/repos/eexit/php-amqplib/pulls{/number}","milestones_url":"https://api.github.com/repos/eexit/php-amqplib/milestones{/number}","notifications_url":"https://api.github.com/repos/eexit/php-amqplib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eexit/php-amqplib/labels{/name}","releases_url":"https://api.github.com/repos/eexit/php-amqplib/releases{/id}","created_at":"2014-08-13T17:25:48Z","updated_at":"2015-01-14T23:14:12Z","pushed_at":"2015-10-07T15:32:52Z","git_url":"git://github.com/eexit/php-amqplib.git","ssh_url":"git@github.com:eexit/php-amqplib.git","clone_url":"https://github.com/eexit/php-amqplib.git","svn_url":"https://github.com/eexit/php-amqplib","homepage":"","size":5972,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"videlalvaro:master","ref":"master","sha":"1d64326be24c8c9f74d0b3003035ec945bc4a787","user":{"login":"videlalvaro","id":30834,"avatar_url":"https://avatars.githubusercontent.com/u/30834?v=3","gravatar_id":"","url":"https://api.github.com/users/videlalvaro","html_url":"https://github.com/videlalvaro","followers_url":"https://api.github.com/users/videlalvaro/followers","following_url":"https://api.github.com/users/videlalvaro/following{/other_user}","gists_url":"https://api.github.com/users/videlalvaro/gists{/gist_id}","starred_url":"https://api.github.com/users/videlalvaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videlalvaro/subscriptions","organizations_url":"https://api.github.com/users/videlalvaro/orgs","repos_url":"https://api.github.com/users/videlalvaro/repos","events_url":"https://api.github.com/users/videlalvaro/events{/privacy}","received_events_url":"https://api.github.com/users/videlalvaro/received_events","type":"User","site_admin":false},"repo":{"id":2784293,"name":"php-amqplib","full_name":"videlalvaro/php-amqplib","owner":{"login":"videlalvaro","id":30834,"avatar_url":"https://avatars.githubusercontent.com/u/30834?v=3","gravatar_id":"","url":"https://api.github.com/users/videlalvaro","html_url":"https://github.com/videlalvaro","followers_url":"https://api.github.com/users/videlalvaro/followers","following_url":"https://api.github.com/users/videlalvaro/following{/other_user}","gists_url":"https://api.github.com/users/videlalvaro/gists{/gist_id}","starred_url":"https://api.github.com/users/videlalvaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videlalvaro/subscriptions","organizations_url":"https://api.github.com/users/videlalvaro/orgs","repos_url":"https://api.github.com/users/videlalvaro/repos","events_url":"https://api.github.com/users/videlalvaro/events{/privacy}","received_events_url":"https://api.github.com/users/videlalvaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/videlalvaro/php-amqplib","description":"AMQP library for PHP","fork":false,"url":"https://api.github.com/repos/videlalvaro/php-amqplib","forks_url":"https://api.github.com/repos/videlalvaro/php-amqplib/forks","keys_url":"https://api.github.com/repos/videlalvaro/php-amqplib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videlalvaro/php-amqplib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videlalvaro/php-amqplib/teams","hooks_url":"https://api.github.com/repos/videlalvaro/php-amqplib/hooks","issue_events_url":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/events{/number}","events_url":"https://api.github.com/repos/videlalvaro/php-amqplib/events","assignees_url":"https://api.github.com/repos/videlalvaro/php-amqplib/assignees{/user}","branches_url":"https://api.github.com/repos/videlalvaro/php-amqplib/branches{/branch}","tags_url":"https://api.github.com/repos/videlalvaro/php-amqplib/tags","blobs_url":"https://api.github.com/repos/videlalvaro/php-amqplib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videlalvaro/php-amqplib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videlalvaro/php-amqplib/git/refs{/sha}","trees_url":"https://api.github.com/repos/videlalvaro/php-amqplib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videlalvaro/php-amqplib/statuses/{sha}","languages_url":"https://api.github.com/repos/videlalvaro/php-amqplib/languages","stargazers_url":"https://api.github.com/repos/videlalvaro/php-amqplib/stargazers","contributors_url":"https://api.github.com/repos/videlalvaro/php-amqplib/contributors","subscribers_url":"https://api.github.com/repos/videlalvaro/php-amqplib/subscribers","subscription_url":"https://api.github.com/repos/videlalvaro/php-amqplib/subscription","commits_url":"https://api.github.com/repos/videlalvaro/php-amqplib/commits{/sha}","git_commits_url":"https://api.github.com/repos/videlalvaro/php-amqplib/git/commits{/sha}","comments_url":"https://api.github.com/repos/videlalvaro/php-amqplib/comments{/number}","issue_comment_url":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/comments{/number}","contents_url":"https://api.github.com/repos/videlalvaro/php-amqplib/contents/{+path}","compare_url":"https://api.github.com/repos/videlalvaro/php-amqplib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videlalvaro/php-amqplib/merges","archive_url":"https://api.github.com/repos/videlalvaro/php-amqplib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videlalvaro/php-amqplib/downloads","issues_url":"https://api.github.com/repos/videlalvaro/php-amqplib/issues{/number}","pulls_url":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls{/number}","milestones_url":"https://api.github.com/repos/videlalvaro/php-amqplib/milestones{/number}","notifications_url":"https://api.github.com/repos/videlalvaro/php-amqplib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videlalvaro/php-amqplib/labels{/name}","releases_url":"https://api.github.com/repos/videlalvaro/php-amqplib/releases{/id}","created_at":"2011-11-15T23:49:33Z","updated_at":"2015-10-07T03:55:28Z","pushed_at":"2015-10-07T15:32:53Z","git_url":"git://github.com/videlalvaro/php-amqplib.git","ssh_url":"git@github.com:videlalvaro/php-amqplib.git","clone_url":"https://github.com/videlalvaro/php-amqplib.git","svn_url":"https://github.com/videlalvaro/php-amqplib","homepage":"","size":7073,"stargazers_count":928,"watchers_count":928,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"open_issues_count":65,"forks":291,"open_issues":65,"watchers":928,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201"},"html":{"href":"https://github.com/videlalvaro/php-amqplib/pull/201"},"issue":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/201"},"comments":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/videlalvaro/php-amqplib/statuses/04d168bcf210d14b7b936db2304bb9b3c7039ab6"}}}}