{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4","id":37940944,"html_url":"https://github.com/icicleio/Psr7Bridge/pull/4","diff_url":"https://github.com/icicleio/Psr7Bridge/pull/4.diff","patch_url":"https://github.com/icicleio/Psr7Bridge/pull/4.patch","issue_url":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/4","number":4,"state":"open","locked":false,"title":"Finish testsuite for Stream","user":{"login":"mtymek","id":777893,"avatar_url":"https://avatars.githubusercontent.com/u/777893?v=3","gravatar_id":"","url":"https://api.github.com/users/mtymek","html_url":"https://github.com/mtymek","followers_url":"https://api.github.com/users/mtymek/followers","following_url":"https://api.github.com/users/mtymek/following{/other_user}","gists_url":"https://api.github.com/users/mtymek/gists{/gist_id}","starred_url":"https://api.github.com/users/mtymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtymek/subscriptions","organizations_url":"https://api.github.com/users/mtymek/orgs","repos_url":"https://api.github.com/users/mtymek/repos","events_url":"https://api.github.com/users/mtymek/events{/privacy}","received_events_url":"https://api.github.com/users/mtymek/received_events","type":"User","site_admin":false},"body":"* fixed bug with `eof()`\r\n* almost 100% test coverage\r\n\r\nI also rewrote tests back to Prophecy, discovering interesting fact - you simply cannot use static variables in callback like this:\r\n\r\n```php\r\n$promise->isPending()->will(function () {\r\n            static $pending = true;\r\n            if ($pending) {\r\n                // Schedule a function to simulate an event that resolves the promise.\r\n                Loop\\schedule(function () use (&$pending) {\r\n                    $pending = false;\r\n                });\r\n            }\r\n            return $pending;\r\n        });\r\n```\r\n\r\nThis is because Prophecy binds closure, which apparently creates new one, with \"fresh\" static vars:\r\n\r\n```php\r\nif ($callback instanceof Closure && method_exists('Closure', 'bind')) {\r\n            $callback = Closure::bind($callback, $object);\r\n        }\r\n\r\n        return call_user_func($callback, $args, $object, $method);\r\n```\r\n\r\nIn order to fix this issue, I have to use variable from one scope above.","created_at":"2015-06-17T20:07:45Z","updated_at":"2015-06-17T20:07:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4/commits","review_comments_url":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4/comments","review_comment_url":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/4/comments","statuses_url":"https://api.github.com/repos/icicleio/Psr7Bridge/statuses/69b531a1badcdc4a4e4f9c5921d3b832c87f2a07","head":{"label":"mtymek:finalize_stream","ref":"finalize_stream","sha":"69b531a1badcdc4a4e4f9c5921d3b832c87f2a07","user":{"login":"mtymek","id":777893,"avatar_url":"https://avatars.githubusercontent.com/u/777893?v=3","gravatar_id":"","url":"https://api.github.com/users/mtymek","html_url":"https://github.com/mtymek","followers_url":"https://api.github.com/users/mtymek/followers","following_url":"https://api.github.com/users/mtymek/following{/other_user}","gists_url":"https://api.github.com/users/mtymek/gists{/gist_id}","starred_url":"https://api.github.com/users/mtymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtymek/subscriptions","organizations_url":"https://api.github.com/users/mtymek/orgs","repos_url":"https://api.github.com/users/mtymek/repos","events_url":"https://api.github.com/users/mtymek/events{/privacy}","received_events_url":"https://api.github.com/users/mtymek/received_events","type":"User","site_admin":false},"repo":{"id":37021829,"name":"Psr7Bridge","full_name":"mtymek/Psr7Bridge","owner":{"login":"mtymek","id":777893,"avatar_url":"https://avatars.githubusercontent.com/u/777893?v=3","gravatar_id":"","url":"https://api.github.com/users/mtymek","html_url":"https://github.com/mtymek","followers_url":"https://api.github.com/users/mtymek/followers","following_url":"https://api.github.com/users/mtymek/following{/other_user}","gists_url":"https://api.github.com/users/mtymek/gists{/gist_id}","starred_url":"https://api.github.com/users/mtymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtymek/subscriptions","organizations_url":"https://api.github.com/users/mtymek/orgs","repos_url":"https://api.github.com/users/mtymek/repos","events_url":"https://api.github.com/users/mtymek/events{/privacy}","received_events_url":"https://api.github.com/users/mtymek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mtymek/Psr7Bridge","description":null,"fork":true,"url":"https://api.github.com/repos/mtymek/Psr7Bridge","forks_url":"https://api.github.com/repos/mtymek/Psr7Bridge/forks","keys_url":"https://api.github.com/repos/mtymek/Psr7Bridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mtymek/Psr7Bridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mtymek/Psr7Bridge/teams","hooks_url":"https://api.github.com/repos/mtymek/Psr7Bridge/hooks","issue_events_url":"https://api.github.com/repos/mtymek/Psr7Bridge/issues/events{/number}","events_url":"https://api.github.com/repos/mtymek/Psr7Bridge/events","assignees_url":"https://api.github.com/repos/mtymek/Psr7Bridge/assignees{/user}","branches_url":"https://api.github.com/repos/mtymek/Psr7Bridge/branches{/branch}","tags_url":"https://api.github.com/repos/mtymek/Psr7Bridge/tags","blobs_url":"https://api.github.com/repos/mtymek/Psr7Bridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mtymek/Psr7Bridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mtymek/Psr7Bridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/mtymek/Psr7Bridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mtymek/Psr7Bridge/statuses/{sha}","languages_url":"https://api.github.com/repos/mtymek/Psr7Bridge/languages","stargazers_url":"https://api.github.com/repos/mtymek/Psr7Bridge/stargazers","contributors_url":"https://api.github.com/repos/mtymek/Psr7Bridge/contributors","subscribers_url":"https://api.github.com/repos/mtymek/Psr7Bridge/subscribers","subscription_url":"https://api.github.com/repos/mtymek/Psr7Bridge/subscription","commits_url":"https://api.github.com/repos/mtymek/Psr7Bridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/mtymek/Psr7Bridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/mtymek/Psr7Bridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/mtymek/Psr7Bridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/mtymek/Psr7Bridge/contents/{+path}","compare_url":"https://api.github.com/repos/mtymek/Psr7Bridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mtymek/Psr7Bridge/merges","archive_url":"https://api.github.com/repos/mtymek/Psr7Bridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mtymek/Psr7Bridge/downloads","issues_url":"https://api.github.com/repos/mtymek/Psr7Bridge/issues{/number}","pulls_url":"https://api.github.com/repos/mtymek/Psr7Bridge/pulls{/number}","milestones_url":"https://api.github.com/repos/mtymek/Psr7Bridge/milestones{/number}","notifications_url":"https://api.github.com/repos/mtymek/Psr7Bridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mtymek/Psr7Bridge/labels{/name}","releases_url":"https://api.github.com/repos/mtymek/Psr7Bridge/releases{/id}","created_at":"2015-06-07T15:40:35Z","updated_at":"2015-06-07T15:40:36Z","pushed_at":"2015-06-17T20:03:26Z","git_url":"git://github.com/mtymek/Psr7Bridge.git","ssh_url":"git@github.com:mtymek/Psr7Bridge.git","clone_url":"https://github.com/mtymek/Psr7Bridge.git","svn_url":"https://github.com/mtymek/Psr7Bridge","homepage":null,"size":107,"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":"icicleio:master","ref":"master","sha":"b9cead3c82185d12e46ee75fda4dd9f474d78fd9","user":{"login":"icicleio","id":8062803,"avatar_url":"https://avatars.githubusercontent.com/u/8062803?v=3","gravatar_id":"","url":"https://api.github.com/users/icicleio","html_url":"https://github.com/icicleio","followers_url":"https://api.github.com/users/icicleio/followers","following_url":"https://api.github.com/users/icicleio/following{/other_user}","gists_url":"https://api.github.com/users/icicleio/gists{/gist_id}","starred_url":"https://api.github.com/users/icicleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icicleio/subscriptions","organizations_url":"https://api.github.com/users/icicleio/orgs","repos_url":"https://api.github.com/users/icicleio/repos","events_url":"https://api.github.com/users/icicleio/events{/privacy}","received_events_url":"https://api.github.com/users/icicleio/received_events","type":"Organization","site_admin":false},"repo":{"id":36842698,"name":"Psr7Bridge","full_name":"icicleio/Psr7Bridge","owner":{"login":"icicleio","id":8062803,"avatar_url":"https://avatars.githubusercontent.com/u/8062803?v=3","gravatar_id":"","url":"https://api.github.com/users/icicleio","html_url":"https://github.com/icicleio","followers_url":"https://api.github.com/users/icicleio/followers","following_url":"https://api.github.com/users/icicleio/following{/other_user}","gists_url":"https://api.github.com/users/icicleio/gists{/gist_id}","starred_url":"https://api.github.com/users/icicleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icicleio/subscriptions","organizations_url":"https://api.github.com/users/icicleio/orgs","repos_url":"https://api.github.com/users/icicleio/repos","events_url":"https://api.github.com/users/icicleio/events{/privacy}","received_events_url":"https://api.github.com/users/icicleio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/icicleio/Psr7Bridge","description":"PSR-7 Bridge for Icicle HTTP component","fork":false,"url":"https://api.github.com/repos/icicleio/Psr7Bridge","forks_url":"https://api.github.com/repos/icicleio/Psr7Bridge/forks","keys_url":"https://api.github.com/repos/icicleio/Psr7Bridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/icicleio/Psr7Bridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/icicleio/Psr7Bridge/teams","hooks_url":"https://api.github.com/repos/icicleio/Psr7Bridge/hooks","issue_events_url":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/events{/number}","events_url":"https://api.github.com/repos/icicleio/Psr7Bridge/events","assignees_url":"https://api.github.com/repos/icicleio/Psr7Bridge/assignees{/user}","branches_url":"https://api.github.com/repos/icicleio/Psr7Bridge/branches{/branch}","tags_url":"https://api.github.com/repos/icicleio/Psr7Bridge/tags","blobs_url":"https://api.github.com/repos/icicleio/Psr7Bridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/icicleio/Psr7Bridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/icicleio/Psr7Bridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/icicleio/Psr7Bridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/icicleio/Psr7Bridge/statuses/{sha}","languages_url":"https://api.github.com/repos/icicleio/Psr7Bridge/languages","stargazers_url":"https://api.github.com/repos/icicleio/Psr7Bridge/stargazers","contributors_url":"https://api.github.com/repos/icicleio/Psr7Bridge/contributors","subscribers_url":"https://api.github.com/repos/icicleio/Psr7Bridge/subscribers","subscription_url":"https://api.github.com/repos/icicleio/Psr7Bridge/subscription","commits_url":"https://api.github.com/repos/icicleio/Psr7Bridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/icicleio/Psr7Bridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/icicleio/Psr7Bridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/icicleio/Psr7Bridge/contents/{+path}","compare_url":"https://api.github.com/repos/icicleio/Psr7Bridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/icicleio/Psr7Bridge/merges","archive_url":"https://api.github.com/repos/icicleio/Psr7Bridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/icicleio/Psr7Bridge/downloads","issues_url":"https://api.github.com/repos/icicleio/Psr7Bridge/issues{/number}","pulls_url":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls{/number}","milestones_url":"https://api.github.com/repos/icicleio/Psr7Bridge/milestones{/number}","notifications_url":"https://api.github.com/repos/icicleio/Psr7Bridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/icicleio/Psr7Bridge/labels{/name}","releases_url":"https://api.github.com/repos/icicleio/Psr7Bridge/releases{/id}","created_at":"2015-06-04T02:19:37Z","updated_at":"2015-06-09T22:12:24Z","pushed_at":"2015-06-09T22:10:59Z","git_url":"git://github.com/icicleio/Psr7Bridge.git","ssh_url":"git@github.com:icicleio/Psr7Bridge.git","clone_url":"https://github.com/icicleio/Psr7Bridge.git","svn_url":"https://github.com/icicleio/Psr7Bridge","homepage":"https://icicle.io","size":159,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4"},"html":{"href":"https://github.com/icicleio/Psr7Bridge/pull/4"},"issue":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/4"},"comments":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/icicleio/Psr7Bridge/statuses/69b531a1badcdc4a4e4f9c5921d3b832c87f2a07"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":187,"deletions":79,"changed_files":2}}