{"action":"created","comment":{"url":"https://api.github.com/repos/laravel/framework/pulls/comments/59131001","id":59131001,"diff_hunk":"@@ -300,6 +300,27 @@ public function flip()\n     }\n \n     /**\n+     * Determine if the callable is true for all items in the collection.\n+     *\n+     * @param  callable $callable\n+     *\n+     * @return bool\n+     */\n+    public function forAll(callable $callable)\n+    {\n+        $values = $this->values()->toArray();\n+\n+        while (! empty($values)) {\n+            $item = array_shift($values);\n+            if (! $callable($item)) {\n+                return false;\n+            }\n+        }\n+\n+        return true;\n+    }","path":"src/Illuminate/Support/Collection.php","position":22,"original_position":22,"commit_id":"1b2af2afbdb3dbd45855bd05a446b4051477139a","original_commit_id":"1b2af2afbdb3dbd45855bd05a446b4051477139a","user":{"login":"petemcfarlane","id":3472717,"avatar_url":"https://avatars.githubusercontent.com/u/3472717?v=3","gravatar_id":"","url":"https://api.github.com/users/petemcfarlane","html_url":"https://github.com/petemcfarlane","followers_url":"https://api.github.com/users/petemcfarlane/followers","following_url":"https://api.github.com/users/petemcfarlane/following{/other_user}","gists_url":"https://api.github.com/users/petemcfarlane/gists{/gist_id}","starred_url":"https://api.github.com/users/petemcfarlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemcfarlane/subscriptions","organizations_url":"https://api.github.com/users/petemcfarlane/orgs","repos_url":"https://api.github.com/users/petemcfarlane/repos","events_url":"https://api.github.com/users/petemcfarlane/events{/privacy}","received_events_url":"https://api.github.com/users/petemcfarlane/received_events","type":"User","site_admin":false},"body":"Ok then, that makes sense to change. \n\n> On 10 Apr 2016, at 04:24, Joseph Silber <notifications@github.com> wrote:\n> \n> In src/Illuminate/Support/Collection.php:\n> \n> > +     *\n> > +     * @return bool\n> > +     */\n> > +    public function forAll(callable $callable)\n> > +    {\n> > +        $values = $this->values()->toArray();\n> > +\n> > +        while (! empty($values)) {\n> > +            $item = array_shift($values);\n> > +            if (! $callable($item)) {\n> > +                return false;\n> > +            }\n> > +        }\n> > +\n> > +        return true;\n> > +    }\n> $callable is kind of a generic name for a predicate. We're using $callback everywhere else.\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> \n","created_at":"2016-04-10T10:08:55Z","updated_at":"2016-04-10T10:08:55Z","html_url":"https://github.com/laravel/framework/pull/13071#discussion_r59131001","pull_request_url":"https://api.github.com/repos/laravel/framework/pulls/13071","_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments/59131001"},"html":{"href":"https://github.com/laravel/framework/pull/13071#discussion_r59131001"},"pull_request":{"href":"https://api.github.com/repos/laravel/framework/pulls/13071"}}},"pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/13071","id":65654802,"html_url":"https://github.com/laravel/framework/pull/13071","diff_url":"https://github.com/laravel/framework/pull/13071.diff","patch_url":"https://github.com/laravel/framework/pull/13071.patch","issue_url":"https://api.github.com/repos/laravel/framework/issues/13071","number":13071,"state":"open","locked":false,"title":"[5.2] Adds a transpose() and forAll() methods to the Collection object","user":{"login":"petemcfarlane","id":3472717,"avatar_url":"https://avatars.githubusercontent.com/u/3472717?v=3","gravatar_id":"","url":"https://api.github.com/users/petemcfarlane","html_url":"https://github.com/petemcfarlane","followers_url":"https://api.github.com/users/petemcfarlane/followers","following_url":"https://api.github.com/users/petemcfarlane/following{/other_user}","gists_url":"https://api.github.com/users/petemcfarlane/gists{/gist_id}","starred_url":"https://api.github.com/users/petemcfarlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemcfarlane/subscriptions","organizations_url":"https://api.github.com/users/petemcfarlane/orgs","repos_url":"https://api.github.com/users/petemcfarlane/repos","events_url":"https://api.github.com/users/petemcfarlane/events{/privacy}","received_events_url":"https://api.github.com/users/petemcfarlane/received_events","type":"User","site_admin":false},"body":"Takes some ideas from this blog post by Adam Wathan to add a transpose() method to the collection object. \r\nhttp://adamwathan.me/2016/04/06/cleaning-up-form-input-with-transpose/\r\n\r\nAlso added a `forAll($c)` method which returns true/false if a given callable $c holds true for every item in the collection (and used by the transpose method to make sure every item is an array.)","created_at":"2016-04-07T15:56:41Z","updated_at":"2016-04-10T10:08:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66797d27934a3fe390635594a233b88fe620cd60","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/framework/pulls/13071/commits","review_comments_url":"https://api.github.com/repos/laravel/framework/pulls/13071/comments","review_comment_url":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/framework/issues/13071/comments","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/1b2af2afbdb3dbd45855bd05a446b4051477139a","head":{"label":"petemcfarlane:5.2","ref":"5.2","sha":"1b2af2afbdb3dbd45855bd05a446b4051477139a","user":{"login":"petemcfarlane","id":3472717,"avatar_url":"https://avatars.githubusercontent.com/u/3472717?v=3","gravatar_id":"","url":"https://api.github.com/users/petemcfarlane","html_url":"https://github.com/petemcfarlane","followers_url":"https://api.github.com/users/petemcfarlane/followers","following_url":"https://api.github.com/users/petemcfarlane/following{/other_user}","gists_url":"https://api.github.com/users/petemcfarlane/gists{/gist_id}","starred_url":"https://api.github.com/users/petemcfarlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemcfarlane/subscriptions","organizations_url":"https://api.github.com/users/petemcfarlane/orgs","repos_url":"https://api.github.com/users/petemcfarlane/repos","events_url":"https://api.github.com/users/petemcfarlane/events{/privacy}","received_events_url":"https://api.github.com/users/petemcfarlane/received_events","type":"User","site_admin":false},"repo":{"id":55701484,"name":"framework","full_name":"petemcfarlane/framework","owner":{"login":"petemcfarlane","id":3472717,"avatar_url":"https://avatars.githubusercontent.com/u/3472717?v=3","gravatar_id":"","url":"https://api.github.com/users/petemcfarlane","html_url":"https://github.com/petemcfarlane","followers_url":"https://api.github.com/users/petemcfarlane/followers","following_url":"https://api.github.com/users/petemcfarlane/following{/other_user}","gists_url":"https://api.github.com/users/petemcfarlane/gists{/gist_id}","starred_url":"https://api.github.com/users/petemcfarlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemcfarlane/subscriptions","organizations_url":"https://api.github.com/users/petemcfarlane/orgs","repos_url":"https://api.github.com/users/petemcfarlane/repos","events_url":"https://api.github.com/users/petemcfarlane/events{/privacy}","received_events_url":"https://api.github.com/users/petemcfarlane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petemcfarlane/framework","description":"","fork":true,"url":"https://api.github.com/repos/petemcfarlane/framework","forks_url":"https://api.github.com/repos/petemcfarlane/framework/forks","keys_url":"https://api.github.com/repos/petemcfarlane/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petemcfarlane/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petemcfarlane/framework/teams","hooks_url":"https://api.github.com/repos/petemcfarlane/framework/hooks","issue_events_url":"https://api.github.com/repos/petemcfarlane/framework/issues/events{/number}","events_url":"https://api.github.com/repos/petemcfarlane/framework/events","assignees_url":"https://api.github.com/repos/petemcfarlane/framework/assignees{/user}","branches_url":"https://api.github.com/repos/petemcfarlane/framework/branches{/branch}","tags_url":"https://api.github.com/repos/petemcfarlane/framework/tags","blobs_url":"https://api.github.com/repos/petemcfarlane/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petemcfarlane/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petemcfarlane/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/petemcfarlane/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petemcfarlane/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/petemcfarlane/framework/languages","stargazers_url":"https://api.github.com/repos/petemcfarlane/framework/stargazers","contributors_url":"https://api.github.com/repos/petemcfarlane/framework/contributors","subscribers_url":"https://api.github.com/repos/petemcfarlane/framework/subscribers","subscription_url":"https://api.github.com/repos/petemcfarlane/framework/subscription","commits_url":"https://api.github.com/repos/petemcfarlane/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/petemcfarlane/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/petemcfarlane/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/petemcfarlane/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/petemcfarlane/framework/contents/{+path}","compare_url":"https://api.github.com/repos/petemcfarlane/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petemcfarlane/framework/merges","archive_url":"https://api.github.com/repos/petemcfarlane/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petemcfarlane/framework/downloads","issues_url":"https://api.github.com/repos/petemcfarlane/framework/issues{/number}","pulls_url":"https://api.github.com/repos/petemcfarlane/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/petemcfarlane/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/petemcfarlane/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petemcfarlane/framework/labels{/name}","releases_url":"https://api.github.com/repos/petemcfarlane/framework/releases{/id}","deployments_url":"https://api.github.com/repos/petemcfarlane/framework/deployments","created_at":"2016-04-07T14:30:21Z","updated_at":"2016-04-07T14:30:26Z","pushed_at":"2016-04-07T16:27:06Z","git_url":"git://github.com/petemcfarlane/framework.git","ssh_url":"git@github.com:petemcfarlane/framework.git","clone_url":"https://github.com/petemcfarlane/framework.git","svn_url":"https://github.com/petemcfarlane/framework","homepage":"http://laravel.com","size":22573,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.2"}},"base":{"label":"laravel:5.2","ref":"5.2","sha":"3d95b0328395b2682ac507a1c81bbeafab8b646b","user":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"repo":{"id":7548986,"name":"framework","full_name":"laravel/framework","owner":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/laravel/framework","description":"","fork":false,"url":"https://api.github.com/repos/laravel/framework","forks_url":"https://api.github.com/repos/laravel/framework/forks","keys_url":"https://api.github.com/repos/laravel/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/framework/teams","hooks_url":"https://api.github.com/repos/laravel/framework/hooks","issue_events_url":"https://api.github.com/repos/laravel/framework/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/framework/events","assignees_url":"https://api.github.com/repos/laravel/framework/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/framework/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/framework/tags","blobs_url":"https://api.github.com/repos/laravel/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/framework/languages","stargazers_url":"https://api.github.com/repos/laravel/framework/stargazers","contributors_url":"https://api.github.com/repos/laravel/framework/contributors","subscribers_url":"https://api.github.com/repos/laravel/framework/subscribers","subscription_url":"https://api.github.com/repos/laravel/framework/subscription","commits_url":"https://api.github.com/repos/laravel/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/framework/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/framework/merges","archive_url":"https://api.github.com/repos/laravel/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/framework/downloads","issues_url":"https://api.github.com/repos/laravel/framework/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/framework/labels{/name}","releases_url":"https://api.github.com/repos/laravel/framework/releases{/id}","deployments_url":"https://api.github.com/repos/laravel/framework/deployments","created_at":"2013-01-10T21:27:28Z","updated_at":"2016-04-10T08:06:49Z","pushed_at":"2016-04-09T22:18:09Z","git_url":"git://github.com/laravel/framework.git","ssh_url":"git@github.com:laravel/framework.git","clone_url":"https://github.com/laravel/framework.git","svn_url":"https://github.com/laravel/framework","homepage":"http://laravel.com","size":36737,"stargazers_count":5089,"watchers_count":5089,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2937,"mirror_url":null,"open_issues_count":124,"forks":2937,"open_issues":124,"watchers":5089,"default_branch":"5.2"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/13071"},"html":{"href":"https://github.com/laravel/framework/pull/13071"},"issue":{"href":"https://api.github.com/repos/laravel/framework/issues/13071"},"comments":{"href":"https://api.github.com/repos/laravel/framework/issues/13071/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/framework/pulls/13071/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/framework/pulls/13071/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/framework/statuses/1b2af2afbdb3dbd45855bd05a446b4051477139a"}}}}