{"action":"created","comment":{"url":"https://api.github.com/repos/guzzle/psr7/pulls/comments/85964918","pull_request_review_id":6647962,"id":85964918,"diff_hunk":"@@ -208,7 +208,17 @@ public function read($length)\n             throw new \\RuntimeException('Cannot read from non-readable stream');\n         }\n \n-        return fread($this->stream, $length);\n+        if (0 === $length) {\n+            return '';\n+        }\n+\n+        $string = $length > 0 ? fread($this->stream, $length) : false;","path":"src/Stream.php","position":9,"original_position":9,"commit_id":"995835fa168dc40aac3513a6ff2c759455bbb208","original_commit_id":"995835fa168dc40aac3513a6ff2c759455bbb208","user":{"login":"Tobion","id":610090,"avatar_url":"https://avatars.githubusercontent.com/u/610090?v=3","gravatar_id":"","url":"https://api.github.com/users/Tobion","html_url":"https://github.com/Tobion","followers_url":"https://api.github.com/users/Tobion/followers","following_url":"https://api.github.com/users/Tobion/following{/other_user}","gists_url":"https://api.github.com/users/Tobion/gists{/gist_id}","starred_url":"https://api.github.com/users/Tobion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tobion/subscriptions","organizations_url":"https://api.github.com/users/Tobion/orgs","repos_url":"https://api.github.com/users/Tobion/repos","events_url":"https://api.github.com/users/Tobion/events{/privacy}","received_events_url":"https://api.github.com/users/Tobion/received_events","type":"User","site_admin":false},"body":"Please throw an explicit RuntimeException when $length < 0 saying that \"Length parameter cannot be negative\".","created_at":"2016-11-01T16:26:12Z","updated_at":"2016-11-01T16:26:12Z","html_url":"https://github.com/guzzle/psr7/pull/125#discussion_r85964918","pull_request_url":"https://api.github.com/repos/guzzle/psr7/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/comments/85964918"},"html":{"href":"https://github.com/guzzle/psr7/pull/125#discussion_r85964918"},"pull_request":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/guzzle/psr7/pulls/125","id":91773266,"html_url":"https://github.com/guzzle/psr7/pull/125","diff_url":"https://github.com/guzzle/psr7/pull/125.diff","patch_url":"https://github.com/guzzle/psr7/pull/125.patch","issue_url":"https://api.github.com/repos/guzzle/psr7/issues/125","number":125,"state":"open","locked":false,"title":"Suppress warning for `Stream::read` method call","user":{"login":"zyfran","id":100966,"avatar_url":"https://avatars.githubusercontent.com/u/100966?v=3","gravatar_id":"","url":"https://api.github.com/users/zyfran","html_url":"https://github.com/zyfran","followers_url":"https://api.github.com/users/zyfran/followers","following_url":"https://api.github.com/users/zyfran/following{/other_user}","gists_url":"https://api.github.com/users/zyfran/gists{/gist_id}","starred_url":"https://api.github.com/users/zyfran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyfran/subscriptions","organizations_url":"https://api.github.com/users/zyfran/orgs","repos_url":"https://api.github.com/users/zyfran/repos","events_url":"https://api.github.com/users/zyfran/events{/privacy}","received_events_url":"https://api.github.com/users/zyfran/received_events","type":"User","site_admin":false},"body":" - if `$length === 0` return empty string\r\n - if `$length < 0` throw `RuntimeException`\r\n - if `fread` return false throw RuntimeException\r\n\r\nAdd PHPUnit tests\r\n\r\nIssue #119 ","created_at":"2016-11-01T12:12:29Z","updated_at":"2016-11-01T16:26:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c152e717d172a48420a0f6f50f90850064d37835","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/guzzle/psr7/pulls/125/commits","review_comments_url":"https://api.github.com/repos/guzzle/psr7/pulls/125/comments","review_comment_url":"https://api.github.com/repos/guzzle/psr7/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guzzle/psr7/issues/125/comments","statuses_url":"https://api.github.com/repos/guzzle/psr7/statuses/995835fa168dc40aac3513a6ff2c759455bbb208","head":{"label":"zyfran:fix_warning_stream_read","ref":"fix_warning_stream_read","sha":"995835fa168dc40aac3513a6ff2c759455bbb208","user":{"login":"zyfran","id":100966,"avatar_url":"https://avatars.githubusercontent.com/u/100966?v=3","gravatar_id":"","url":"https://api.github.com/users/zyfran","html_url":"https://github.com/zyfran","followers_url":"https://api.github.com/users/zyfran/followers","following_url":"https://api.github.com/users/zyfran/following{/other_user}","gists_url":"https://api.github.com/users/zyfran/gists{/gist_id}","starred_url":"https://api.github.com/users/zyfran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyfran/subscriptions","organizations_url":"https://api.github.com/users/zyfran/orgs","repos_url":"https://api.github.com/users/zyfran/repos","events_url":"https://api.github.com/users/zyfran/events{/privacy}","received_events_url":"https://api.github.com/users/zyfran/received_events","type":"User","site_admin":false},"repo":{"id":72529623,"name":"psr7","full_name":"zyfran/psr7","owner":{"login":"zyfran","id":100966,"avatar_url":"https://avatars.githubusercontent.com/u/100966?v=3","gravatar_id":"","url":"https://api.github.com/users/zyfran","html_url":"https://github.com/zyfran","followers_url":"https://api.github.com/users/zyfran/followers","following_url":"https://api.github.com/users/zyfran/following{/other_user}","gists_url":"https://api.github.com/users/zyfran/gists{/gist_id}","starred_url":"https://api.github.com/users/zyfran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyfran/subscriptions","organizations_url":"https://api.github.com/users/zyfran/orgs","repos_url":"https://api.github.com/users/zyfran/repos","events_url":"https://api.github.com/users/zyfran/events{/privacy}","received_events_url":"https://api.github.com/users/zyfran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zyfran/psr7","description":"PSR-7 HTTP message library","fork":true,"url":"https://api.github.com/repos/zyfran/psr7","forks_url":"https://api.github.com/repos/zyfran/psr7/forks","keys_url":"https://api.github.com/repos/zyfran/psr7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zyfran/psr7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zyfran/psr7/teams","hooks_url":"https://api.github.com/repos/zyfran/psr7/hooks","issue_events_url":"https://api.github.com/repos/zyfran/psr7/issues/events{/number}","events_url":"https://api.github.com/repos/zyfran/psr7/events","assignees_url":"https://api.github.com/repos/zyfran/psr7/assignees{/user}","branches_url":"https://api.github.com/repos/zyfran/psr7/branches{/branch}","tags_url":"https://api.github.com/repos/zyfran/psr7/tags","blobs_url":"https://api.github.com/repos/zyfran/psr7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zyfran/psr7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zyfran/psr7/git/refs{/sha}","trees_url":"https://api.github.com/repos/zyfran/psr7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zyfran/psr7/statuses/{sha}","languages_url":"https://api.github.com/repos/zyfran/psr7/languages","stargazers_url":"https://api.github.com/repos/zyfran/psr7/stargazers","contributors_url":"https://api.github.com/repos/zyfran/psr7/contributors","subscribers_url":"https://api.github.com/repos/zyfran/psr7/subscribers","subscription_url":"https://api.github.com/repos/zyfran/psr7/subscription","commits_url":"https://api.github.com/repos/zyfran/psr7/commits{/sha}","git_commits_url":"https://api.github.com/repos/zyfran/psr7/git/commits{/sha}","comments_url":"https://api.github.com/repos/zyfran/psr7/comments{/number}","issue_comment_url":"https://api.github.com/repos/zyfran/psr7/issues/comments{/number}","contents_url":"https://api.github.com/repos/zyfran/psr7/contents/{+path}","compare_url":"https://api.github.com/repos/zyfran/psr7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zyfran/psr7/merges","archive_url":"https://api.github.com/repos/zyfran/psr7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zyfran/psr7/downloads","issues_url":"https://api.github.com/repos/zyfran/psr7/issues{/number}","pulls_url":"https://api.github.com/repos/zyfran/psr7/pulls{/number}","milestones_url":"https://api.github.com/repos/zyfran/psr7/milestones{/number}","notifications_url":"https://api.github.com/repos/zyfran/psr7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zyfran/psr7/labels{/name}","releases_url":"https://api.github.com/repos/zyfran/psr7/releases{/id}","deployments_url":"https://api.github.com/repos/zyfran/psr7/deployments","created_at":"2016-11-01T11:22:42Z","updated_at":"2016-11-01T11:22:44Z","pushed_at":"2016-11-01T12:09:53Z","git_url":"git://github.com/zyfran/psr7.git","ssh_url":"git@github.com:zyfran/psr7.git","clone_url":"https://github.com/zyfran/psr7.git","svn_url":"https://github.com/zyfran/psr7","homepage":"","size":292,"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":"guzzle:master","ref":"master","sha":"64862e854f876bc5aee2996cab2f552db8586065","user":{"login":"guzzle","id":638632,"avatar_url":"https://avatars.githubusercontent.com/u/638632?v=3","gravatar_id":"","url":"https://api.github.com/users/guzzle","html_url":"https://github.com/guzzle","followers_url":"https://api.github.com/users/guzzle/followers","following_url":"https://api.github.com/users/guzzle/following{/other_user}","gists_url":"https://api.github.com/users/guzzle/gists{/gist_id}","starred_url":"https://api.github.com/users/guzzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guzzle/subscriptions","organizations_url":"https://api.github.com/users/guzzle/orgs","repos_url":"https://api.github.com/users/guzzle/repos","events_url":"https://api.github.com/users/guzzle/events{/privacy}","received_events_url":"https://api.github.com/users/guzzle/received_events","type":"Organization","site_admin":false},"repo":{"id":31295421,"name":"psr7","full_name":"guzzle/psr7","owner":{"login":"guzzle","id":638632,"avatar_url":"https://avatars.githubusercontent.com/u/638632?v=3","gravatar_id":"","url":"https://api.github.com/users/guzzle","html_url":"https://github.com/guzzle","followers_url":"https://api.github.com/users/guzzle/followers","following_url":"https://api.github.com/users/guzzle/following{/other_user}","gists_url":"https://api.github.com/users/guzzle/gists{/gist_id}","starred_url":"https://api.github.com/users/guzzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guzzle/subscriptions","organizations_url":"https://api.github.com/users/guzzle/orgs","repos_url":"https://api.github.com/users/guzzle/repos","events_url":"https://api.github.com/users/guzzle/events{/privacy}","received_events_url":"https://api.github.com/users/guzzle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guzzle/psr7","description":"PSR-7 HTTP message library","fork":false,"url":"https://api.github.com/repos/guzzle/psr7","forks_url":"https://api.github.com/repos/guzzle/psr7/forks","keys_url":"https://api.github.com/repos/guzzle/psr7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guzzle/psr7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guzzle/psr7/teams","hooks_url":"https://api.github.com/repos/guzzle/psr7/hooks","issue_events_url":"https://api.github.com/repos/guzzle/psr7/issues/events{/number}","events_url":"https://api.github.com/repos/guzzle/psr7/events","assignees_url":"https://api.github.com/repos/guzzle/psr7/assignees{/user}","branches_url":"https://api.github.com/repos/guzzle/psr7/branches{/branch}","tags_url":"https://api.github.com/repos/guzzle/psr7/tags","blobs_url":"https://api.github.com/repos/guzzle/psr7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guzzle/psr7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guzzle/psr7/git/refs{/sha}","trees_url":"https://api.github.com/repos/guzzle/psr7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guzzle/psr7/statuses/{sha}","languages_url":"https://api.github.com/repos/guzzle/psr7/languages","stargazers_url":"https://api.github.com/repos/guzzle/psr7/stargazers","contributors_url":"https://api.github.com/repos/guzzle/psr7/contributors","subscribers_url":"https://api.github.com/repos/guzzle/psr7/subscribers","subscription_url":"https://api.github.com/repos/guzzle/psr7/subscription","commits_url":"https://api.github.com/repos/guzzle/psr7/commits{/sha}","git_commits_url":"https://api.github.com/repos/guzzle/psr7/git/commits{/sha}","comments_url":"https://api.github.com/repos/guzzle/psr7/comments{/number}","issue_comment_url":"https://api.github.com/repos/guzzle/psr7/issues/comments{/number}","contents_url":"https://api.github.com/repos/guzzle/psr7/contents/{+path}","compare_url":"https://api.github.com/repos/guzzle/psr7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guzzle/psr7/merges","archive_url":"https://api.github.com/repos/guzzle/psr7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guzzle/psr7/downloads","issues_url":"https://api.github.com/repos/guzzle/psr7/issues{/number}","pulls_url":"https://api.github.com/repos/guzzle/psr7/pulls{/number}","milestones_url":"https://api.github.com/repos/guzzle/psr7/milestones{/number}","notifications_url":"https://api.github.com/repos/guzzle/psr7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guzzle/psr7/labels{/name}","releases_url":"https://api.github.com/repos/guzzle/psr7/releases{/id}","deployments_url":"https://api.github.com/repos/guzzle/psr7/deployments","created_at":"2015-02-25T03:31:26Z","updated_at":"2016-10-26T20:01:02Z","pushed_at":"2016-11-01T12:12:29Z","git_url":"git://github.com/guzzle/psr7.git","ssh_url":"git@github.com:guzzle/psr7.git","clone_url":"https://github.com/guzzle/psr7.git","svn_url":"https://github.com/guzzle/psr7","homepage":"","size":435,"stargazers_count":150,"watchers_count":150,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":15,"forks":79,"open_issues":15,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/125"},"html":{"href":"https://github.com/guzzle/psr7/pull/125"},"issue":{"href":"https://api.github.com/repos/guzzle/psr7/issues/125"},"comments":{"href":"https://api.github.com/repos/guzzle/psr7/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guzzle/psr7/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/guzzle/psr7/statuses/995835fa168dc40aac3513a6ff2c759455bbb208"}}}}
{"actor":{"display_login":"Tobion"}}