{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/comments/33883111","id":33883111,"diff_hunk":"@@ -174,8 +164,10 @@ public function addIdentifiers($identifiers)\n      * @return ResponseCollection All listener return values\n      * @throws Exception\\InvalidCallbackException\n      */\n-    public function trigger($event, $target = null, $argv = [], $callback = null)\n+    public function trigger($event, $target = null, $argv = array(), callable $callback = null)","path":"src/EventManager.php","position":161,"original_position":161,"commit_id":"9a9d0c70984835425514abd23dfadc5cbc8e1154","original_commit_id":"9a9d0c70984835425514abd23dfadc5cbc8e1154","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"I'll run it through the new CS rules when complete; right now, I'm mainly\ntesting some concepts for refactoring.\nOn Jul 3, 2015 4:50 PM, \"Abdul Malik Ikhsan\" <notifications@github.com>\nwrote:\n\n> In src/EventManager.php\n> <https://github.com/zendframework/zend-eventmanager/pull/4#discussion_r33881585>\n> :\n>\n> > @@ -174,8 +164,10 @@ public function addIdentifiers($identifiers)\n> >       * @return ResponseCollection All listener return values\n> >       * @throws Exception\\InvalidCallbackException\n> >       */\n> > -    public function trigger($event, $target = null, $argv = [], $callback = null)\n> > +    public function trigger($event, $target = null, $argv = array(), callable $callback = null)\n>\n> $argv = array() can be $argv = []\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/zendframework/zend-eventmanager/pull/4/files#r33881585>\n> .\n>\n","created_at":"2015-07-03T23:46:11Z","updated_at":"2015-07-03T23:46:11Z","html_url":"https://github.com/zendframework/zend-eventmanager/pull/4#discussion_r33883111","pull_request_url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/comments/33883111"},"html":{"href":"https://github.com/zendframework/zend-eventmanager/pull/4#discussion_r33883111"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4","id":39128703,"html_url":"https://github.com/zendframework/zend-eventmanager/pull/4","diff_url":"https://github.com/zendframework/zend-eventmanager/pull/4.diff","patch_url":"https://github.com/zendframework/zend-eventmanager/pull/4.patch","issue_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/4","number":4,"state":"open","locked":false,"title":"[WIP] Alternate EventManager refactor","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"- Removes:\r\n  - `SharedEventAggregateAwareInterface::detachAggregate`\r\n  - `SharedEventManagerAwareInterface::getSharedManager` and `unsetSharedManager`.\r\n  - `SharedEventManagerInterface::detach`\r\n  - `EventManagerInterface::detach`, `detachAggregate`, and `addIdentifiers`.\r\n- Modifies:\r\n  - `EventManagerInterface::attach` renames `$callback` to `$listener`, typehints it as callable, and makes it required. The method no longer has a return value.\r\n  - `EventManagerInterface::trigger` now typehints the `$callback` argument as callable\r\n  - `SharedEventManagerInterface::getListeners` now markes the `$event` argument as optional, and returns an array.\r\n- Adds:\r\n  - `Exception\\RuntimeException`\r\n\r\nAll implementations of the above interfaces were modified accordingly.\r\n\r\n`SharedEventManager` was modified to store the various listeners within structured arrays instead of `EventManager` and/or `PriorityQueue` instances.\r\n\r\n`EventManager` was altered to accept both identifiers and a `SharedEventManager` instance to the constructor. Additionally, once both identifiers and the shared manager instance are present, a call is made to a new method, `prepareListeners`; this method does the following:\r\n\r\n- It loops through all identifiers,\r\n- pulls listeners from the shared manager based on those identifiers,\r\n- caching wildcard listeners for later,\r\n- and attaches all other listeners directly to the instance.\r\n\r\nIt then loops through wildcard identifiers, with the same logic.\r\n\r\nFinally, it loops through any known events, and attaches all wildcard listeners to each of the events.\r\n\r\nThe BC breaks from this approach are as follows:\r\n\r\n- Obviously, if you used any of the removed methods, they are no longer available.\r\n\r\n- `CallbackHandler` instances can no longer be used when calling `attach()`\r\n\r\n- Any shared listeners attached *after* the instance is created will not be executed. This means attachment of shared listeners should be done early, preferably during application bootstrap, but really anytime before an instance is fetched from the service manager.\r\n\r\nThe changes, however, are essentially BC with the current solution.\r\n\r\n**My initial benchmarks show that execution is around twice as fast as the current solution.** This keeps the differentiating features of our solution, including the granularity of listener attachment, at a substantial speed savings.\r\n\r\n## TODO\r\n\r\n- [ ] Testing\r\n- [ ] Migration scripts\r\n- [ ] Performance benchmarking tests (via Athletic)","created_at":"2015-07-02T21:41:14Z","updated_at":"2015-07-03T23:46:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97342c8f948fb0de6b240b1ec2c7343c5b3c9bdf","assignee":null,"milestone":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/milestones/2","html_url":"https://github.com/zendframework/zend-eventmanager/milestones/3.0.0","labels_url":"https://api.github.com/repos/zendframework/zend-eventmanager/milestones/2/labels","id":1137638,"number":2,"title":"3.0.0","description":"next backward compatibility break release","creator":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-05-28T09:27:58Z","updated_at":"2015-07-02T21:42:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/4/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-eventmanager/statuses/9a9d0c70984835425514abd23dfadc5cbc8e1154","head":{"label":"weierophinney:feature/sem-refactor","ref":"feature/sem-refactor","sha":"9a9d0c70984835425514abd23dfadc5cbc8e1154","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"repo":{"id":38458190,"name":"zend-eventmanager","full_name":"weierophinney/zend-eventmanager","owner":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weierophinney/zend-eventmanager","description":"EventManager component from Zend Framework","fork":true,"url":"https://api.github.com/repos/weierophinney/zend-eventmanager","forks_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/forks","keys_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/teams","hooks_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/hooks","issue_events_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/issues/events{/number}","events_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/events","assignees_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/assignees{/user}","branches_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/branches{/branch}","tags_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/tags","blobs_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/languages","stargazers_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/stargazers","contributors_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/contributors","subscribers_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/subscribers","subscription_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/subscription","commits_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/contents/{+path}","compare_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/merges","archive_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/downloads","issues_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/issues{/number}","pulls_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/labels{/name}","releases_url":"https://api.github.com/repos/weierophinney/zend-eventmanager/releases{/id}","created_at":"2015-07-02T21:37:32Z","updated_at":"2015-07-02T21:37:32Z","pushed_at":"2015-07-03T16:08:48Z","git_url":"git://github.com/weierophinney/zend-eventmanager.git","ssh_url":"git@github.com:weierophinney/zend-eventmanager.git","clone_url":"https://github.com/weierophinney/zend-eventmanager.git","svn_url":"https://github.com/weierophinney/zend-eventmanager","homepage":"https://github.com/zendframework/zf2","size":2151,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"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":"master"}},"base":{"label":"zendframework:develop","ref":"develop","sha":"aa4b34cf7167a78103e69eadf8b6c140cf8a981e","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35280797,"name":"zend-eventmanager","full_name":"zendframework/zend-eventmanager","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-eventmanager","description":"EventManager component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-eventmanager","forks_url":"https://api.github.com/repos/zendframework/zend-eventmanager/forks","keys_url":"https://api.github.com/repos/zendframework/zend-eventmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-eventmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-eventmanager/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-eventmanager/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-eventmanager/events","assignees_url":"https://api.github.com/repos/zendframework/zend-eventmanager/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-eventmanager/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-eventmanager/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-eventmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-eventmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-eventmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-eventmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-eventmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-eventmanager/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-eventmanager/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-eventmanager/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-eventmanager/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-eventmanager/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-eventmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-eventmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-eventmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-eventmanager/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-eventmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-eventmanager/merges","archive_url":"https://api.github.com/repos/zendframework/zend-eventmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-eventmanager/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-eventmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-eventmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-eventmanager/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-eventmanager/releases{/id}","created_at":"2015-05-08T13:27:57Z","updated_at":"2015-07-02T06:58:06Z","pushed_at":"2015-07-03T16:08:48Z","git_url":"git://github.com/zendframework/zend-eventmanager.git","ssh_url":"git@github.com:zendframework/zend-eventmanager.git","clone_url":"https://github.com/zendframework/zend-eventmanager.git","svn_url":"https://github.com/zendframework/zend-eventmanager","homepage":"https://github.com/zendframework/zf2","size":2151,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":3,"forks":8,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4"},"html":{"href":"https://github.com/zendframework/zend-eventmanager/pull/4"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/4"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-eventmanager/statuses/9a9d0c70984835425514abd23dfadc5cbc8e1154"}}}}