{"action":"created","comment":{"url":"https://api.github.com/repos/phpspec/phpspec/pulls/comments/84598224","pull_request_review_id":5366770,"id":84598224,"diff_hunk":"@@ -0,0 +1,22 @@\n+<?php\n+\n+/*\n+ * This file is part of PhpSpec, A php toolset to drive emergent\n+ * design by specification.\n+ *\n+ * (c) Marcello Duarte <marcello.duarte@gmail.com>\n+ * (c) Konstantin Kudryashov <ever.zet@gmail.com>\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 PhpSpec\\Matcher\\Iterate;\n+\n+class SubjectHasLessElementsException extends \\LengthException\n+{\n+    public function __construct()\n+    {\n+        parent::__construct('Subject has less elements than expected.');","path":"src/PhpSpec/Matcher/Iterate/SubjectHasLessElementsException.php","position":20,"original_position":20,"commit_id":"da30cad40ab5402f6b47705aa50bf2c1554f3810","original_commit_id":"da30cad40ab5402f6b47705aa50bf2c1554f3810","user":{"login":"ciaranmcnulty","id":237866,"avatar_url":"https://avatars.githubusercontent.com/u/237866?v=3","gravatar_id":"","url":"https://api.github.com/users/ciaranmcnulty","html_url":"https://github.com/ciaranmcnulty","followers_url":"https://api.github.com/users/ciaranmcnulty/followers","following_url":"https://api.github.com/users/ciaranmcnulty/following{/other_user}","gists_url":"https://api.github.com/users/ciaranmcnulty/gists{/gist_id}","starred_url":"https://api.github.com/users/ciaranmcnulty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciaranmcnulty/subscriptions","organizations_url":"https://api.github.com/users/ciaranmcnulty/orgs","repos_url":"https://api.github.com/users/ciaranmcnulty/repos","events_url":"https://api.github.com/users/ciaranmcnulty/events{/privacy}","received_events_url":"https://api.github.com/users/ciaranmcnulty/received_events","type":"User","site_admin":false},"body":"This should be \"fewer\" rather than \"less\"","created_at":"2016-10-23T15:33:55Z","updated_at":"2016-10-23T15:46:20Z","html_url":"https://github.com/phpspec/phpspec/pull/1016#discussion_r84598224","pull_request_url":"https://api.github.com/repos/phpspec/phpspec/pulls/1016","_links":{"self":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/comments/84598224"},"html":{"href":"https://github.com/phpspec/phpspec/pull/1016#discussion_r84598224"},"pull_request":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/1016"}}},"pull_request":{"url":"https://api.github.com/repos/phpspec/phpspec/pulls/1016","id":89711079,"html_url":"https://github.com/phpspec/phpspec/pull/1016","diff_url":"https://github.com/phpspec/phpspec/pull/1016.diff","patch_url":"https://github.com/phpspec/phpspec/pull/1016.patch","issue_url":"https://api.github.com/repos/phpspec/phpspec/issues/1016","number":1016,"state":"open","locked":false,"title":"Implement matchers for iterables","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"body":"*Fixes #379, fixes #954.*\r\n\r\nIt's high time to finally get iterators support in PhpSpec (#954).\r\n\r\nI've implemented six matchers for `\\Traversable` objects (mostly useful for finite iterators):\r\n - `shouldHaveCount($count)`\r\n - `shouldHaveKey($key)` *supports infinite iterators*\r\n - `shouldHaveKeyWithValue($key, $value)`\r\n - `shouldContain($value)`\r\n - `shouldIterate(iterable $iterable)`\r\n - `shouldStartIterating(iterable $iterable)` *supports infinite interators*\r\n\r\nThough `\\Traversable` can by only implemented by implementing either `\\Iterator` or `\\IteratorAggregate` and we can always get `\\Iterator` from there, using `iterator_to_array` is not the solution as keys may be duplicated, made of something else than string or integer, it can be infinite and it would use more memory. Therefore, `foreach` was used to make those matchers working.\r\n\r\nTODO:\r\n - before PR review:\r\n   - [x] Better exception messages for `IterateMatcher`\r\n   - [x] Support for infinite iterators in `StartIteratingMatcher`\r\n - after PR review:\r\n   - [ ] Update documentation for existing matchers\r\n   - [ ] Add documentation for new matchers","created_at":"2016-10-17T21:55:45Z","updated_at":"2016-10-23T15:46:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09d27fc9e81e073aa380f4648e486d3d13708a5a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/phpspec/phpspec/pulls/1016/commits","review_comments_url":"https://api.github.com/repos/phpspec/phpspec/pulls/1016/comments","review_comment_url":"https://api.github.com/repos/phpspec/phpspec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phpspec/phpspec/issues/1016/comments","statuses_url":"https://api.github.com/repos/phpspec/phpspec/statuses/da30cad40ab5402f6b47705aa50bf2c1554f3810","head":{"label":"pamil:iterable-matcher","ref":"iterable-matcher","sha":"da30cad40ab5402f6b47705aa50bf2c1554f3810","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"repo":{"id":61068631,"name":"phpspec","full_name":"pamil/phpspec","owner":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pamil/phpspec","description":"SpecBDD Framework for PHP","fork":true,"url":"https://api.github.com/repos/pamil/phpspec","forks_url":"https://api.github.com/repos/pamil/phpspec/forks","keys_url":"https://api.github.com/repos/pamil/phpspec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pamil/phpspec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pamil/phpspec/teams","hooks_url":"https://api.github.com/repos/pamil/phpspec/hooks","issue_events_url":"https://api.github.com/repos/pamil/phpspec/issues/events{/number}","events_url":"https://api.github.com/repos/pamil/phpspec/events","assignees_url":"https://api.github.com/repos/pamil/phpspec/assignees{/user}","branches_url":"https://api.github.com/repos/pamil/phpspec/branches{/branch}","tags_url":"https://api.github.com/repos/pamil/phpspec/tags","blobs_url":"https://api.github.com/repos/pamil/phpspec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pamil/phpspec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pamil/phpspec/git/refs{/sha}","trees_url":"https://api.github.com/repos/pamil/phpspec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pamil/phpspec/statuses/{sha}","languages_url":"https://api.github.com/repos/pamil/phpspec/languages","stargazers_url":"https://api.github.com/repos/pamil/phpspec/stargazers","contributors_url":"https://api.github.com/repos/pamil/phpspec/contributors","subscribers_url":"https://api.github.com/repos/pamil/phpspec/subscribers","subscription_url":"https://api.github.com/repos/pamil/phpspec/subscription","commits_url":"https://api.github.com/repos/pamil/phpspec/commits{/sha}","git_commits_url":"https://api.github.com/repos/pamil/phpspec/git/commits{/sha}","comments_url":"https://api.github.com/repos/pamil/phpspec/comments{/number}","issue_comment_url":"https://api.github.com/repos/pamil/phpspec/issues/comments{/number}","contents_url":"https://api.github.com/repos/pamil/phpspec/contents/{+path}","compare_url":"https://api.github.com/repos/pamil/phpspec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pamil/phpspec/merges","archive_url":"https://api.github.com/repos/pamil/phpspec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pamil/phpspec/downloads","issues_url":"https://api.github.com/repos/pamil/phpspec/issues{/number}","pulls_url":"https://api.github.com/repos/pamil/phpspec/pulls{/number}","milestones_url":"https://api.github.com/repos/pamil/phpspec/milestones{/number}","notifications_url":"https://api.github.com/repos/pamil/phpspec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pamil/phpspec/labels{/name}","releases_url":"https://api.github.com/repos/pamil/phpspec/releases{/id}","deployments_url":"https://api.github.com/repos/pamil/phpspec/deployments","created_at":"2016-06-13T20:48:37Z","updated_at":"2016-06-13T20:48:39Z","pushed_at":"2016-10-19T22:40:40Z","git_url":"git://github.com/pamil/phpspec.git","ssh_url":"git@github.com:pamil/phpspec.git","clone_url":"https://github.com/pamil/phpspec.git","svn_url":"https://github.com/pamil/phpspec","homepage":"http://www.phpspec.net","size":4033,"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":"phpspec:master","ref":"master","sha":"b7dde5f5bf4aa79ec18f00c91f59bf2d81ff80da","user":{"login":"phpspec","id":416702,"avatar_url":"https://avatars.githubusercontent.com/u/416702?v=3","gravatar_id":"","url":"https://api.github.com/users/phpspec","html_url":"https://github.com/phpspec","followers_url":"https://api.github.com/users/phpspec/followers","following_url":"https://api.github.com/users/phpspec/following{/other_user}","gists_url":"https://api.github.com/users/phpspec/gists{/gist_id}","starred_url":"https://api.github.com/users/phpspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpspec/subscriptions","organizations_url":"https://api.github.com/users/phpspec/orgs","repos_url":"https://api.github.com/users/phpspec/repos","events_url":"https://api.github.com/users/phpspec/events{/privacy}","received_events_url":"https://api.github.com/users/phpspec/received_events","type":"Organization","site_admin":false},"repo":{"id":1582219,"name":"phpspec","full_name":"phpspec/phpspec","owner":{"login":"phpspec","id":416702,"avatar_url":"https://avatars.githubusercontent.com/u/416702?v=3","gravatar_id":"","url":"https://api.github.com/users/phpspec","html_url":"https://github.com/phpspec","followers_url":"https://api.github.com/users/phpspec/followers","following_url":"https://api.github.com/users/phpspec/following{/other_user}","gists_url":"https://api.github.com/users/phpspec/gists{/gist_id}","starred_url":"https://api.github.com/users/phpspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpspec/subscriptions","organizations_url":"https://api.github.com/users/phpspec/orgs","repos_url":"https://api.github.com/users/phpspec/repos","events_url":"https://api.github.com/users/phpspec/events{/privacy}","received_events_url":"https://api.github.com/users/phpspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpspec/phpspec","description":"SpecBDD Framework for PHP","fork":false,"url":"https://api.github.com/repos/phpspec/phpspec","forks_url":"https://api.github.com/repos/phpspec/phpspec/forks","keys_url":"https://api.github.com/repos/phpspec/phpspec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpspec/phpspec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpspec/phpspec/teams","hooks_url":"https://api.github.com/repos/phpspec/phpspec/hooks","issue_events_url":"https://api.github.com/repos/phpspec/phpspec/issues/events{/number}","events_url":"https://api.github.com/repos/phpspec/phpspec/events","assignees_url":"https://api.github.com/repos/phpspec/phpspec/assignees{/user}","branches_url":"https://api.github.com/repos/phpspec/phpspec/branches{/branch}","tags_url":"https://api.github.com/repos/phpspec/phpspec/tags","blobs_url":"https://api.github.com/repos/phpspec/phpspec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpspec/phpspec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpspec/phpspec/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpspec/phpspec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpspec/phpspec/statuses/{sha}","languages_url":"https://api.github.com/repos/phpspec/phpspec/languages","stargazers_url":"https://api.github.com/repos/phpspec/phpspec/stargazers","contributors_url":"https://api.github.com/repos/phpspec/phpspec/contributors","subscribers_url":"https://api.github.com/repos/phpspec/phpspec/subscribers","subscription_url":"https://api.github.com/repos/phpspec/phpspec/subscription","commits_url":"https://api.github.com/repos/phpspec/phpspec/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpspec/phpspec/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpspec/phpspec/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpspec/phpspec/issues/comments{/number}","contents_url":"https://api.github.com/repos/phpspec/phpspec/contents/{+path}","compare_url":"https://api.github.com/repos/phpspec/phpspec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpspec/phpspec/merges","archive_url":"https://api.github.com/repos/phpspec/phpspec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpspec/phpspec/downloads","issues_url":"https://api.github.com/repos/phpspec/phpspec/issues{/number}","pulls_url":"https://api.github.com/repos/phpspec/phpspec/pulls{/number}","milestones_url":"https://api.github.com/repos/phpspec/phpspec/milestones{/number}","notifications_url":"https://api.github.com/repos/phpspec/phpspec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpspec/phpspec/labels{/name}","releases_url":"https://api.github.com/repos/phpspec/phpspec/releases{/id}","deployments_url":"https://api.github.com/repos/phpspec/phpspec/deployments","created_at":"2011-04-07T12:48:08Z","updated_at":"2016-10-23T10:28:25Z","pushed_at":"2016-10-23T15:24:27Z","git_url":"git://github.com/phpspec/phpspec.git","ssh_url":"git@github.com:phpspec/phpspec.git","clone_url":"https://github.com/phpspec/phpspec.git","svn_url":"https://github.com/phpspec/phpspec","homepage":"http://www.phpspec.net","size":5526,"stargazers_count":1077,"watchers_count":1077,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":208,"mirror_url":null,"open_issues_count":91,"forks":208,"open_issues":91,"watchers":1077,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/1016"},"html":{"href":"https://github.com/phpspec/phpspec/pull/1016"},"issue":{"href":"https://api.github.com/repos/phpspec/phpspec/issues/1016"},"comments":{"href":"https://api.github.com/repos/phpspec/phpspec/issues/1016/comments"},"review_comments":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/1016/comments"},"review_comment":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phpspec/phpspec/pulls/1016/commits"},"statuses":{"href":"https://api.github.com/repos/phpspec/phpspec/statuses/da30cad40ab5402f6b47705aa50bf2c1554f3810"}}}}
{"actor":{"display_login":"ciaranmcnulty"}}