{"action":"created","comment":{"url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/comments/37711318","id":37711318,"diff_hunk":"@@ -0,0 +1,43 @@\n+<?php\n+\n+namespace Underscore\\Mutator;\n+\n+use Underscore\\Collection;\n+use Underscore\\Mutator;\n+\n+/**\n+ * Class WhereMutator\n+ * @package Underscore\\Mutator\n+ */\n+class WhereMutator extends Mutator\n+{\n+    /**\n+     * Remove all values that do not match the given key-value pairs.\n+     *\n+     * By default strict comparison is used.\n+     *\n+     * @param Collection $collection\n+     * @param array $properties\n+     * @param boolean $strict\n+     * @return Collection\n+     */\n+    public function __invoke($collection, array $properties, $strict = true)\n+    {\n+        $collection = clone $collection;\n+\n+        // This can be refactored to use array_filter once #54 is merged.\n+        foreach ($collection as $index => $item) {\n+            $item = new Collection($item);","path":"src/Mutator/WhereMutator.php","position":30,"original_position":30,"commit_id":"5a086910b51a117d27c4f72c3516dd5b8d971407","original_commit_id":"5a086910b51a117d27c4f72c3516dd5b8d971407","user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"body":"This seemed like the fastest way to ensure that values could be accessed as arrays. Open to suggestions on a better solution.","created_at":"2015-08-23T22:30:51Z","updated_at":"2015-08-23T22:30:51Z","html_url":"https://github.com/Im0rtality/Underscore/pull/58#discussion_r37711318","pull_request_url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/comments/37711318"},"html":{"href":"https://github.com/Im0rtality/Underscore/pull/58#discussion_r37711318"},"pull_request":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58","id":43130045,"html_url":"https://github.com/Im0rtality/Underscore/pull/58","diff_url":"https://github.com/Im0rtality/Underscore/pull/58.diff","patch_url":"https://github.com/Im0rtality/Underscore/pull/58.patch","issue_url":"https://api.github.com/repos/Im0rtality/Underscore/issues/58","number":58,"state":"open","locked":false,"title":"Add where() method","user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"body":"Picks items from the collection that have matching properties.\r\n\r\nStrict by default with an option for looser comparison.\r\n\r\nFixes #8","created_at":"2015-08-23T22:30:01Z","updated_at":"2015-08-23T22:30:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7006a9a2a2b2f940d18acbbe77b74a29d83262a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58/commits","review_comments_url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58/comments","review_comment_url":"https://api.github.com/repos/Im0rtality/Underscore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Im0rtality/Underscore/issues/58/comments","statuses_url":"https://api.github.com/repos/Im0rtality/Underscore/statuses/5a086910b51a117d27c4f72c3516dd5b8d971407","head":{"label":"shadowhand:feature/8-add-where-mutator","ref":"feature/8-add-where-mutator","sha":"5a086910b51a117d27c4f72c3516dd5b8d971407","user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"repo":{"id":38024256,"name":"Underscore","full_name":"shadowhand/Underscore","owner":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shadowhand/Underscore","description":"Functional programming library for PHP","fork":true,"url":"https://api.github.com/repos/shadowhand/Underscore","forks_url":"https://api.github.com/repos/shadowhand/Underscore/forks","keys_url":"https://api.github.com/repos/shadowhand/Underscore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shadowhand/Underscore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shadowhand/Underscore/teams","hooks_url":"https://api.github.com/repos/shadowhand/Underscore/hooks","issue_events_url":"https://api.github.com/repos/shadowhand/Underscore/issues/events{/number}","events_url":"https://api.github.com/repos/shadowhand/Underscore/events","assignees_url":"https://api.github.com/repos/shadowhand/Underscore/assignees{/user}","branches_url":"https://api.github.com/repos/shadowhand/Underscore/branches{/branch}","tags_url":"https://api.github.com/repos/shadowhand/Underscore/tags","blobs_url":"https://api.github.com/repos/shadowhand/Underscore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shadowhand/Underscore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shadowhand/Underscore/git/refs{/sha}","trees_url":"https://api.github.com/repos/shadowhand/Underscore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shadowhand/Underscore/statuses/{sha}","languages_url":"https://api.github.com/repos/shadowhand/Underscore/languages","stargazers_url":"https://api.github.com/repos/shadowhand/Underscore/stargazers","contributors_url":"https://api.github.com/repos/shadowhand/Underscore/contributors","subscribers_url":"https://api.github.com/repos/shadowhand/Underscore/subscribers","subscription_url":"https://api.github.com/repos/shadowhand/Underscore/subscription","commits_url":"https://api.github.com/repos/shadowhand/Underscore/commits{/sha}","git_commits_url":"https://api.github.com/repos/shadowhand/Underscore/git/commits{/sha}","comments_url":"https://api.github.com/repos/shadowhand/Underscore/comments{/number}","issue_comment_url":"https://api.github.com/repos/shadowhand/Underscore/issues/comments{/number}","contents_url":"https://api.github.com/repos/shadowhand/Underscore/contents/{+path}","compare_url":"https://api.github.com/repos/shadowhand/Underscore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shadowhand/Underscore/merges","archive_url":"https://api.github.com/repos/shadowhand/Underscore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shadowhand/Underscore/downloads","issues_url":"https://api.github.com/repos/shadowhand/Underscore/issues{/number}","pulls_url":"https://api.github.com/repos/shadowhand/Underscore/pulls{/number}","milestones_url":"https://api.github.com/repos/shadowhand/Underscore/milestones{/number}","notifications_url":"https://api.github.com/repos/shadowhand/Underscore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shadowhand/Underscore/labels{/name}","releases_url":"https://api.github.com/repos/shadowhand/Underscore/releases{/id}","created_at":"2015-06-25T02:52:07Z","updated_at":"2015-06-25T02:52:07Z","pushed_at":"2015-08-23T22:29:28Z","git_url":"git://github.com/shadowhand/Underscore.git","ssh_url":"git@github.com:shadowhand/Underscore.git","clone_url":"https://github.com/shadowhand/Underscore.git","svn_url":"https://github.com/shadowhand/Underscore","homepage":"","size":320,"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":"Im0rtality:master","ref":"master","sha":"c94fb33bcd3ed5d2e659f4de93f8d092b573db0d","user":{"login":"Im0rtality","id":1804210,"avatar_url":"https://avatars.githubusercontent.com/u/1804210?v=3","gravatar_id":"","url":"https://api.github.com/users/Im0rtality","html_url":"https://github.com/Im0rtality","followers_url":"https://api.github.com/users/Im0rtality/followers","following_url":"https://api.github.com/users/Im0rtality/following{/other_user}","gists_url":"https://api.github.com/users/Im0rtality/gists{/gist_id}","starred_url":"https://api.github.com/users/Im0rtality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Im0rtality/subscriptions","organizations_url":"https://api.github.com/users/Im0rtality/orgs","repos_url":"https://api.github.com/users/Im0rtality/repos","events_url":"https://api.github.com/users/Im0rtality/events{/privacy}","received_events_url":"https://api.github.com/users/Im0rtality/received_events","type":"User","site_admin":false},"repo":{"id":17561896,"name":"Underscore","full_name":"Im0rtality/Underscore","owner":{"login":"Im0rtality","id":1804210,"avatar_url":"https://avatars.githubusercontent.com/u/1804210?v=3","gravatar_id":"","url":"https://api.github.com/users/Im0rtality","html_url":"https://github.com/Im0rtality","followers_url":"https://api.github.com/users/Im0rtality/followers","following_url":"https://api.github.com/users/Im0rtality/following{/other_user}","gists_url":"https://api.github.com/users/Im0rtality/gists{/gist_id}","starred_url":"https://api.github.com/users/Im0rtality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Im0rtality/subscriptions","organizations_url":"https://api.github.com/users/Im0rtality/orgs","repos_url":"https://api.github.com/users/Im0rtality/repos","events_url":"https://api.github.com/users/Im0rtality/events{/privacy}","received_events_url":"https://api.github.com/users/Im0rtality/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Im0rtality/Underscore","description":"Functional programming library for PHP","fork":false,"url":"https://api.github.com/repos/Im0rtality/Underscore","forks_url":"https://api.github.com/repos/Im0rtality/Underscore/forks","keys_url":"https://api.github.com/repos/Im0rtality/Underscore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Im0rtality/Underscore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Im0rtality/Underscore/teams","hooks_url":"https://api.github.com/repos/Im0rtality/Underscore/hooks","issue_events_url":"https://api.github.com/repos/Im0rtality/Underscore/issues/events{/number}","events_url":"https://api.github.com/repos/Im0rtality/Underscore/events","assignees_url":"https://api.github.com/repos/Im0rtality/Underscore/assignees{/user}","branches_url":"https://api.github.com/repos/Im0rtality/Underscore/branches{/branch}","tags_url":"https://api.github.com/repos/Im0rtality/Underscore/tags","blobs_url":"https://api.github.com/repos/Im0rtality/Underscore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Im0rtality/Underscore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Im0rtality/Underscore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Im0rtality/Underscore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Im0rtality/Underscore/statuses/{sha}","languages_url":"https://api.github.com/repos/Im0rtality/Underscore/languages","stargazers_url":"https://api.github.com/repos/Im0rtality/Underscore/stargazers","contributors_url":"https://api.github.com/repos/Im0rtality/Underscore/contributors","subscribers_url":"https://api.github.com/repos/Im0rtality/Underscore/subscribers","subscription_url":"https://api.github.com/repos/Im0rtality/Underscore/subscription","commits_url":"https://api.github.com/repos/Im0rtality/Underscore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Im0rtality/Underscore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Im0rtality/Underscore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Im0rtality/Underscore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Im0rtality/Underscore/contents/{+path}","compare_url":"https://api.github.com/repos/Im0rtality/Underscore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Im0rtality/Underscore/merges","archive_url":"https://api.github.com/repos/Im0rtality/Underscore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Im0rtality/Underscore/downloads","issues_url":"https://api.github.com/repos/Im0rtality/Underscore/issues{/number}","pulls_url":"https://api.github.com/repos/Im0rtality/Underscore/pulls{/number}","milestones_url":"https://api.github.com/repos/Im0rtality/Underscore/milestones{/number}","notifications_url":"https://api.github.com/repos/Im0rtality/Underscore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Im0rtality/Underscore/labels{/name}","releases_url":"https://api.github.com/repos/Im0rtality/Underscore/releases{/id}","created_at":"2014-03-09T10:03:13Z","updated_at":"2015-07-17T09:36:26Z","pushed_at":"2015-08-23T22:30:02Z","git_url":"git://github.com/Im0rtality/Underscore.git","ssh_url":"git@github.com:Im0rtality/Underscore.git","clone_url":"https://github.com/Im0rtality/Underscore.git","svn_url":"https://github.com/Im0rtality/Underscore","homepage":"","size":738,"stargazers_count":20,"watchers_count":20,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":21,"forks":2,"open_issues":21,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58"},"html":{"href":"https://github.com/Im0rtality/Underscore/pull/58"},"issue":{"href":"https://api.github.com/repos/Im0rtality/Underscore/issues/58"},"comments":{"href":"https://api.github.com/repos/Im0rtality/Underscore/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Im0rtality/Underscore/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/Im0rtality/Underscore/statuses/5a086910b51a117d27c4f72c3516dd5b8d971407"}}}}