{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/76435476","id":76435476,"diff_hunk":"@@ -686,6 +686,47 @@ public function _unwrap()\n      *\n      * @return \\Cake\\Collection\\CollectionInterface\n      */\n+    public function cartesianProduct(callable $operation = null, callable $filter = null)\n+    {\n+        if ($this->isEmpty()) {\n+            return new Collection([]);\n+        }\n+\n+        $result = [];\n+        $counts = $this->map(function ($arr) {\n+            return count($arr);\n+        })->toList();\n+        $allArr = $this->toList();\n+        $lastIndex = count($allArr) - 1;\n+        // holds the indexes of the arrays that generate the current combination\n+        $currentIndexes = array_fill(0, $lastIndex + 1, 0);\n+        $changeIndex = $lastIndex;\n+\n+        while (!($changeIndex === 0 AND $currentIndexes[0] === $counts[0])) {\n+            $currentCombination = array_map(function ($arr, $index) {\n+                return $arr[$index];\n+            }, $allArr, $currentIndexes);\n+\n+            if ($filter === null OR $filter(...$currentCombination)) {","path":"src/Collection/CollectionTrait.php","position":25,"original_position":25,"commit_id":"ef803bcc757973932bfcfae557f8535555c517ee","original_commit_id":"ef803bcc757973932bfcfae557f8535555c517ee","user":{"login":"stickler-ci","id":16011037,"avatar_url":"https://avatars.githubusercontent.com/u/16011037?v=3","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"PHP keywords must be lowercase; expected \"or\" but found \"OR\"\nLogical operator \"or\" is prohibited; use \"||\" instead","created_at":"2016-08-26T15:13:21Z","updated_at":"2016-08-26T15:13:21Z","html_url":"https://github.com/cakephp/cakephp/pull/9351#discussion_r76435476","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9351","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/76435476"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9351#discussion_r76435476"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9351"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/9351","id":82904962,"html_url":"https://github.com/cakephp/cakephp/pull/9351","diff_url":"https://github.com/cakephp/cakephp/pull/9351.diff","patch_url":"https://github.com/cakephp/cakephp/pull/9351.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/9351","number":9351,"state":"open","locked":false,"title":"Add cartesianProduct to Collection","user":{"login":"hytromo","id":131824,"avatar_url":"https://avatars.githubusercontent.com/u/131824?v=3","gravatar_id":"","url":"https://api.github.com/users/hytromo","html_url":"https://github.com/hytromo","followers_url":"https://api.github.com/users/hytromo/followers","following_url":"https://api.github.com/users/hytromo/following{/other_user}","gists_url":"https://api.github.com/users/hytromo/gists{/gist_id}","starred_url":"https://api.github.com/users/hytromo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hytromo/subscriptions","organizations_url":"https://api.github.com/users/hytromo/orgs","repos_url":"https://api.github.com/users/hytromo/repos","events_url":"https://api.github.com/users/hytromo/events{/privacy}","received_events_url":"https://api.github.com/users/hytromo/received_events","type":"User","site_admin":false},"body":"To resolve #9121 \r\n\r\n","created_at":"2016-08-26T15:12:53Z","updated_at":"2016-08-26T15:13:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9155a70815ea47575bb24fd8eb9aae320995d602","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9351/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9351/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/9351/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/ef803bcc757973932bfcfae557f8535555c517ee","head":{"label":"hytromo:add-cartesian-product-to-collection","ref":"add-cartesian-product-to-collection","sha":"ef803bcc757973932bfcfae557f8535555c517ee","user":{"login":"hytromo","id":131824,"avatar_url":"https://avatars.githubusercontent.com/u/131824?v=3","gravatar_id":"","url":"https://api.github.com/users/hytromo","html_url":"https://github.com/hytromo","followers_url":"https://api.github.com/users/hytromo/followers","following_url":"https://api.github.com/users/hytromo/following{/other_user}","gists_url":"https://api.github.com/users/hytromo/gists{/gist_id}","starred_url":"https://api.github.com/users/hytromo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hytromo/subscriptions","organizations_url":"https://api.github.com/users/hytromo/orgs","repos_url":"https://api.github.com/users/hytromo/repos","events_url":"https://api.github.com/users/hytromo/events{/privacy}","received_events_url":"https://api.github.com/users/hytromo/received_events","type":"User","site_admin":false},"repo":{"id":66656068,"name":"cakephp","full_name":"hytromo/cakephp","owner":{"login":"hytromo","id":131824,"avatar_url":"https://avatars.githubusercontent.com/u/131824?v=3","gravatar_id":"","url":"https://api.github.com/users/hytromo","html_url":"https://github.com/hytromo","followers_url":"https://api.github.com/users/hytromo/followers","following_url":"https://api.github.com/users/hytromo/following{/other_user}","gists_url":"https://api.github.com/users/hytromo/gists{/gist_id}","starred_url":"https://api.github.com/users/hytromo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hytromo/subscriptions","organizations_url":"https://api.github.com/users/hytromo/orgs","repos_url":"https://api.github.com/users/hytromo/repos","events_url":"https://api.github.com/users/hytromo/events{/privacy}","received_events_url":"https://api.github.com/users/hytromo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hytromo/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/hytromo/cakephp","forks_url":"https://api.github.com/repos/hytromo/cakephp/forks","keys_url":"https://api.github.com/repos/hytromo/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hytromo/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hytromo/cakephp/teams","hooks_url":"https://api.github.com/repos/hytromo/cakephp/hooks","issue_events_url":"https://api.github.com/repos/hytromo/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/hytromo/cakephp/events","assignees_url":"https://api.github.com/repos/hytromo/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/hytromo/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/hytromo/cakephp/tags","blobs_url":"https://api.github.com/repos/hytromo/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hytromo/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hytromo/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/hytromo/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hytromo/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/hytromo/cakephp/languages","stargazers_url":"https://api.github.com/repos/hytromo/cakephp/stargazers","contributors_url":"https://api.github.com/repos/hytromo/cakephp/contributors","subscribers_url":"https://api.github.com/repos/hytromo/cakephp/subscribers","subscription_url":"https://api.github.com/repos/hytromo/cakephp/subscription","commits_url":"https://api.github.com/repos/hytromo/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/hytromo/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/hytromo/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/hytromo/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/hytromo/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/hytromo/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hytromo/cakephp/merges","archive_url":"https://api.github.com/repos/hytromo/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hytromo/cakephp/downloads","issues_url":"https://api.github.com/repos/hytromo/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/hytromo/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/hytromo/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/hytromo/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hytromo/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/hytromo/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/hytromo/cakephp/deployments","created_at":"2016-08-26T14:55:07Z","updated_at":"2016-08-26T14:55:17Z","pushed_at":"2016-08-26T15:10:57Z","git_url":"git://github.com/hytromo/cakephp.git","ssh_url":"git@github.com:hytromo/cakephp.git","clone_url":"https://github.com/hytromo/cakephp.git","svn_url":"https://github.com/hytromo/cakephp","homepage":"http://cakephp.org","size":130250,"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":"cakephp:master","ref":"master","sha":"8694e6b680cddefe3b17e41e0ee45b9288932ede","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":656494,"name":"cakephp","full_name":"cakephp/cakephp","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/cakephp/deployments","created_at":"2010-05-08T14:38:22Z","updated_at":"2016-08-25T18:49:36Z","pushed_at":"2016-08-26T15:13:21Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":130250,"stargazers_count":6669,"watchers_count":6669,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3031,"mirror_url":null,"open_issues_count":198,"forks":3031,"open_issues":198,"watchers":6669,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9351"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9351"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9351"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9351/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9351/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9351/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/ef803bcc757973932bfcfae557f8535555c517ee"}}}}
{"actor":{"display_login":"stickler-ci"}}