{"action":"created","comment":{"url":"https://api.github.com/repos/Submitty/Submitty/pulls/comments/229290503","pull_request_review_id":169752428,"id":229290503,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTI5MDUwMw==","diff_hunk":"@@ -2,27 +2,38 @@\n \n namespace app\\libraries;\n \n+use app\\exceptions\\NotImplementedException;\n+\n /**\n  * Class MultiIterator\n  * @package app\\libraries\n  *\n- * Allows the chaining of multiple iterators in one iterator object\n+ * An iterator that allows for sequentially iterating over each passed\n+ * iterator in-order, one at a time. This means that iterator2 will not be\n+ * called until iterator1 has been exhausted. This differs from\n+ * MultipleIterator as that commits all iterator functions over all attached\n+ * iterators in parallel (i.e. calling next() will return an array with the\n+ * results of next() on all attached iterators).\n+ *\n+ * @see \\MultipleIterator\n  */\n class MultiIterator implements \\Iterator {\n \n-    /** @var array array of [\\Closure, $this] */\n-    private $iterator_generators = [];\n+    /** @var \\Iterator[] */\n+    private $iterators = [];\n+    /** @var int */\n+    private $iterator_key = 0;\n     /** @var \\Iterator */\n     private $curr_it = null;","path":"site/app/libraries/MultiIterator.php","position":29,"original_position":29,"commit_id":"8ed9a9b48147c39f50ea826eded73f18ec76f907","original_commit_id":"8ed9a9b48147c39f50ea826eded73f18ec76f907","user":{"login":"KevinMackenzie","id":3719964,"node_id":"MDQ6VXNlcjM3MTk5NjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3719964?v=4","gravatar_id":"","url":"https://api.github.com/users/KevinMackenzie","html_url":"https://github.com/KevinMackenzie","followers_url":"https://api.github.com/users/KevinMackenzie/followers","following_url":"https://api.github.com/users/KevinMackenzie/following{/other_user}","gists_url":"https://api.github.com/users/KevinMackenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinMackenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinMackenzie/subscriptions","organizations_url":"https://api.github.com/users/KevinMackenzie/orgs","repos_url":"https://api.github.com/users/KevinMackenzie/repos","events_url":"https://api.github.com/users/KevinMackenzie/events{/privacy}","received_events_url":"https://api.github.com/users/KevinMackenzie/received_events","type":"User","site_admin":false},"body":"We can get rid of the `curr_it` field since we're using `iterator_key` to index the array of iterators","created_at":"2018-10-30T12:46:22Z","updated_at":"2018-10-30T12:49:28Z","html_url":"https://github.com/Submitty/Submitty/pull/3076#discussion_r229290503","pull_request_url":"https://api.github.com/repos/Submitty/Submitty/pulls/3076","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/comments/229290503"},"html":{"href":"https://github.com/Submitty/Submitty/pull/3076#discussion_r229290503"},"pull_request":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/3076"}}},"pull_request":{"url":"https://api.github.com/repos/Submitty/Submitty/pulls/3076","id":226800484,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2ODAwNDg0","html_url":"https://github.com/Submitty/Submitty/pull/3076","diff_url":"https://github.com/Submitty/Submitty/pull/3076.diff","patch_url":"https://github.com/Submitty/Submitty/pull/3076.patch","issue_url":"https://api.github.com/repos/Submitty/Submitty/issues/3076","number":3076,"state":"open","locked":false,"title":"Modify MultiIterator to operate on normal iterators","user":{"login":"MasterOdin","id":1845314,"node_id":"MDQ6VXNlcjE4NDUzMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1845314?v=4","gravatar_id":"","url":"https://api.github.com/users/MasterOdin","html_url":"https://github.com/MasterOdin","followers_url":"https://api.github.com/users/MasterOdin/followers","following_url":"https://api.github.com/users/MasterOdin/following{/other_user}","gists_url":"https://api.github.com/users/MasterOdin/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterOdin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterOdin/subscriptions","organizations_url":"https://api.github.com/users/MasterOdin/orgs","repos_url":"https://api.github.com/users/MasterOdin/repos","events_url":"https://api.github.com/users/MasterOdin/events{/privacy}","received_events_url":"https://api.github.com/users/MasterOdin/received_events","type":"User","site_admin":false},"body":"PDO allows for multiple statements to be active at the same time without having to first go through the whole result set of a particular statement first before going into the next statement (you could also do this to interweave the result sets of queries). Additionally, as we're already using DatabaseRowIterator under the hood here, there's little cost to PHP itself to have two open statements.\r\n\r\nAs such, we can simplify the implementation of the MultiIterator such that we can use it for any type of iterator, not just databases, which eases the implementation and testing of it.\r\n\r\nAfter this change, I saw no affect in:\r\n* Submitting assignment\r\n* Viewing grading summary for individual assignment\r\n* Grading individual assignment\r\n* Viewing grading summary for team assignment\r\n* Grading team assignment","created_at":"2018-10-30T05:57:01Z","updated_at":"2018-10-30T12:49:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce6da3959ead1d620d1b33cff69d95c4c27c5c16","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Submitty/Submitty/pulls/3076/commits","review_comments_url":"https://api.github.com/repos/Submitty/Submitty/pulls/3076/comments","review_comment_url":"https://api.github.com/repos/Submitty/Submitty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Submitty/Submitty/issues/3076/comments","statuses_url":"https://api.github.com/repos/Submitty/Submitty/statuses/8ed9a9b48147c39f50ea826eded73f18ec76f907","head":{"label":"Submitty:multi_iterator","ref":"multi_iterator","sha":"8ed9a9b48147c39f50ea826eded73f18ec76f907","user":{"login":"Submitty","id":10768785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzY4Nzg1","avatar_url":"https://avatars2.githubusercontent.com/u/10768785?v=4","gravatar_id":"","url":"https://api.github.com/users/Submitty","html_url":"https://github.com/Submitty","followers_url":"https://api.github.com/users/Submitty/followers","following_url":"https://api.github.com/users/Submitty/following{/other_user}","gists_url":"https://api.github.com/users/Submitty/gists{/gist_id}","starred_url":"https://api.github.com/users/Submitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Submitty/subscriptions","organizations_url":"https://api.github.com/users/Submitty/orgs","repos_url":"https://api.github.com/users/Submitty/repos","events_url":"https://api.github.com/users/Submitty/events{/privacy}","received_events_url":"https://api.github.com/users/Submitty/received_events","type":"Organization","site_admin":false},"repo":{"id":16236118,"node_id":"MDEwOlJlcG9zaXRvcnkxNjIzNjExOA==","name":"Submitty","full_name":"Submitty/Submitty","private":false,"owner":{"login":"Submitty","id":10768785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzY4Nzg1","avatar_url":"https://avatars2.githubusercontent.com/u/10768785?v=4","gravatar_id":"","url":"https://api.github.com/users/Submitty","html_url":"https://github.com/Submitty","followers_url":"https://api.github.com/users/Submitty/followers","following_url":"https://api.github.com/users/Submitty/following{/other_user}","gists_url":"https://api.github.com/users/Submitty/gists{/gist_id}","starred_url":"https://api.github.com/users/Submitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Submitty/subscriptions","organizations_url":"https://api.github.com/users/Submitty/orgs","repos_url":"https://api.github.com/users/Submitty/repos","events_url":"https://api.github.com/users/Submitty/events{/privacy}","received_events_url":"https://api.github.com/users/Submitty/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Submitty/Submitty","description":"Homework Submission, Automated Grading, and TA grading system.","fork":false,"url":"https://api.github.com/repos/Submitty/Submitty","forks_url":"https://api.github.com/repos/Submitty/Submitty/forks","keys_url":"https://api.github.com/repos/Submitty/Submitty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Submitty/Submitty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Submitty/Submitty/teams","hooks_url":"https://api.github.com/repos/Submitty/Submitty/hooks","issue_events_url":"https://api.github.com/repos/Submitty/Submitty/issues/events{/number}","events_url":"https://api.github.com/repos/Submitty/Submitty/events","assignees_url":"https://api.github.com/repos/Submitty/Submitty/assignees{/user}","branches_url":"https://api.github.com/repos/Submitty/Submitty/branches{/branch}","tags_url":"https://api.github.com/repos/Submitty/Submitty/tags","blobs_url":"https://api.github.com/repos/Submitty/Submitty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Submitty/Submitty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Submitty/Submitty/git/refs{/sha}","trees_url":"https://api.github.com/repos/Submitty/Submitty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Submitty/Submitty/statuses/{sha}","languages_url":"https://api.github.com/repos/Submitty/Submitty/languages","stargazers_url":"https://api.github.com/repos/Submitty/Submitty/stargazers","contributors_url":"https://api.github.com/repos/Submitty/Submitty/contributors","subscribers_url":"https://api.github.com/repos/Submitty/Submitty/subscribers","subscription_url":"https://api.github.com/repos/Submitty/Submitty/subscription","commits_url":"https://api.github.com/repos/Submitty/Submitty/commits{/sha}","git_commits_url":"https://api.github.com/repos/Submitty/Submitty/git/commits{/sha}","comments_url":"https://api.github.com/repos/Submitty/Submitty/comments{/number}","issue_comment_url":"https://api.github.com/repos/Submitty/Submitty/issues/comments{/number}","contents_url":"https://api.github.com/repos/Submitty/Submitty/contents/{+path}","compare_url":"https://api.github.com/repos/Submitty/Submitty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Submitty/Submitty/merges","archive_url":"https://api.github.com/repos/Submitty/Submitty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Submitty/Submitty/downloads","issues_url":"https://api.github.com/repos/Submitty/Submitty/issues{/number}","pulls_url":"https://api.github.com/repos/Submitty/Submitty/pulls{/number}","milestones_url":"https://api.github.com/repos/Submitty/Submitty/milestones{/number}","notifications_url":"https://api.github.com/repos/Submitty/Submitty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Submitty/Submitty/labels{/name}","releases_url":"https://api.github.com/repos/Submitty/Submitty/releases{/id}","deployments_url":"https://api.github.com/repos/Submitty/Submitty/deployments","created_at":"2014-01-25T17:43:57Z","updated_at":"2018-10-28T23:19:43Z","pushed_at":"2018-10-30T11:32:24Z","git_url":"git://github.com/Submitty/Submitty.git","ssh_url":"git@github.com:Submitty/Submitty.git","clone_url":"https://github.com/Submitty/Submitty.git","svn_url":"https://github.com/Submitty/Submitty","homepage":"http://submitty.org","size":33939,"stargazers_count":106,"watchers_count":106,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":312,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":57,"open_issues":312,"watchers":106,"default_branch":"master"}},"base":{"label":"Submitty:master","ref":"master","sha":"f65b5511fcf4f13e45f047167986acc31e67abb7","user":{"login":"Submitty","id":10768785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzY4Nzg1","avatar_url":"https://avatars2.githubusercontent.com/u/10768785?v=4","gravatar_id":"","url":"https://api.github.com/users/Submitty","html_url":"https://github.com/Submitty","followers_url":"https://api.github.com/users/Submitty/followers","following_url":"https://api.github.com/users/Submitty/following{/other_user}","gists_url":"https://api.github.com/users/Submitty/gists{/gist_id}","starred_url":"https://api.github.com/users/Submitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Submitty/subscriptions","organizations_url":"https://api.github.com/users/Submitty/orgs","repos_url":"https://api.github.com/users/Submitty/repos","events_url":"https://api.github.com/users/Submitty/events{/privacy}","received_events_url":"https://api.github.com/users/Submitty/received_events","type":"Organization","site_admin":false},"repo":{"id":16236118,"node_id":"MDEwOlJlcG9zaXRvcnkxNjIzNjExOA==","name":"Submitty","full_name":"Submitty/Submitty","private":false,"owner":{"login":"Submitty","id":10768785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzY4Nzg1","avatar_url":"https://avatars2.githubusercontent.com/u/10768785?v=4","gravatar_id":"","url":"https://api.github.com/users/Submitty","html_url":"https://github.com/Submitty","followers_url":"https://api.github.com/users/Submitty/followers","following_url":"https://api.github.com/users/Submitty/following{/other_user}","gists_url":"https://api.github.com/users/Submitty/gists{/gist_id}","starred_url":"https://api.github.com/users/Submitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Submitty/subscriptions","organizations_url":"https://api.github.com/users/Submitty/orgs","repos_url":"https://api.github.com/users/Submitty/repos","events_url":"https://api.github.com/users/Submitty/events{/privacy}","received_events_url":"https://api.github.com/users/Submitty/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Submitty/Submitty","description":"Homework Submission, Automated Grading, and TA grading system.","fork":false,"url":"https://api.github.com/repos/Submitty/Submitty","forks_url":"https://api.github.com/repos/Submitty/Submitty/forks","keys_url":"https://api.github.com/repos/Submitty/Submitty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Submitty/Submitty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Submitty/Submitty/teams","hooks_url":"https://api.github.com/repos/Submitty/Submitty/hooks","issue_events_url":"https://api.github.com/repos/Submitty/Submitty/issues/events{/number}","events_url":"https://api.github.com/repos/Submitty/Submitty/events","assignees_url":"https://api.github.com/repos/Submitty/Submitty/assignees{/user}","branches_url":"https://api.github.com/repos/Submitty/Submitty/branches{/branch}","tags_url":"https://api.github.com/repos/Submitty/Submitty/tags","blobs_url":"https://api.github.com/repos/Submitty/Submitty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Submitty/Submitty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Submitty/Submitty/git/refs{/sha}","trees_url":"https://api.github.com/repos/Submitty/Submitty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Submitty/Submitty/statuses/{sha}","languages_url":"https://api.github.com/repos/Submitty/Submitty/languages","stargazers_url":"https://api.github.com/repos/Submitty/Submitty/stargazers","contributors_url":"https://api.github.com/repos/Submitty/Submitty/contributors","subscribers_url":"https://api.github.com/repos/Submitty/Submitty/subscribers","subscription_url":"https://api.github.com/repos/Submitty/Submitty/subscription","commits_url":"https://api.github.com/repos/Submitty/Submitty/commits{/sha}","git_commits_url":"https://api.github.com/repos/Submitty/Submitty/git/commits{/sha}","comments_url":"https://api.github.com/repos/Submitty/Submitty/comments{/number}","issue_comment_url":"https://api.github.com/repos/Submitty/Submitty/issues/comments{/number}","contents_url":"https://api.github.com/repos/Submitty/Submitty/contents/{+path}","compare_url":"https://api.github.com/repos/Submitty/Submitty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Submitty/Submitty/merges","archive_url":"https://api.github.com/repos/Submitty/Submitty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Submitty/Submitty/downloads","issues_url":"https://api.github.com/repos/Submitty/Submitty/issues{/number}","pulls_url":"https://api.github.com/repos/Submitty/Submitty/pulls{/number}","milestones_url":"https://api.github.com/repos/Submitty/Submitty/milestones{/number}","notifications_url":"https://api.github.com/repos/Submitty/Submitty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Submitty/Submitty/labels{/name}","releases_url":"https://api.github.com/repos/Submitty/Submitty/releases{/id}","deployments_url":"https://api.github.com/repos/Submitty/Submitty/deployments","created_at":"2014-01-25T17:43:57Z","updated_at":"2018-10-28T23:19:43Z","pushed_at":"2018-10-30T11:32:24Z","git_url":"git://github.com/Submitty/Submitty.git","ssh_url":"git@github.com:Submitty/Submitty.git","clone_url":"https://github.com/Submitty/Submitty.git","svn_url":"https://github.com/Submitty/Submitty","homepage":"http://submitty.org","size":33939,"stargazers_count":106,"watchers_count":106,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":312,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":57,"open_issues":312,"watchers":106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/3076"},"html":{"href":"https://github.com/Submitty/Submitty/pull/3076"},"issue":{"href":"https://api.github.com/repos/Submitty/Submitty/issues/3076"},"comments":{"href":"https://api.github.com/repos/Submitty/Submitty/issues/3076/comments"},"review_comments":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/3076/comments"},"review_comment":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Submitty/Submitty/pulls/3076/commits"},"statuses":{"href":"https://api.github.com/repos/Submitty/Submitty/statuses/8ed9a9b48147c39f50ea826eded73f18ec76f907"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"KevinMackenzie"}}