{"action":"created","comment":{"url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/comments/70643969","id":70643969,"diff_hunk":"@@ -0,0 +1,79 @@\n+<?php\n+\n+/**\n+ * Copyright 2016 SURFnet B.V.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+namespace Surfnet\\StepupMiddleware\\ApiBundle\\Configuration\\EventListener;\n+\n+use Broadway\\Domain\\DomainMessage;\n+use Broadway\\EventHandling\\EventListenerInterface;\n+use Rhumsaa\\Uuid\\Uuid;\n+use Surfnet\\Stepup\\Configuration\\Value\\Institution;\n+use Surfnet\\Stepup\\Identity\\Event\\IdentityCreatedEvent;\n+use Surfnet\\StepupMiddleware\\ApiBundle\\Configuration\\Repository\\ConfiguredInstitutionRepository;\n+use Surfnet\\StepupMiddleware\\CommandHandlingBundle\\Configuration\\Command\\CreateInstitutionConfigurationCommand;\n+use Surfnet\\StepupMiddleware\\CommandHandlingBundle\\Pipeline\\Pipeline;\n+\n+final class IdentityEventListener implements EventListenerInterface\n+{\n+    /**\n+     * @var ConfiguredInstitutionRepository\n+     */\n+    private $configuredInstitutionRepository;\n+\n+    /**\n+     * @var Pipeline\n+     */\n+    private $pipeline;\n+\n+    public function __construct(ConfiguredInstitutionRepository $configuredInstitutionRepository, Pipeline $pipeline)\n+    {\n+        $this->configuredInstitutionRepository = $configuredInstitutionRepository;\n+        $this->pipeline                        = $pipeline;\n+    }\n+\n+    /**\n+     * @param DomainMessage $domainMessage\n+     */\n+    public function handle(DomainMessage $domainMessage)","path":"src/Surfnet/StepupMiddleware/ApiBundle/Configuration/EventListener/IdentityEventListener.php","position":51,"original_position":51,"commit_id":"bda0330c94bc05f7d5e2b119affe8af661ff3ff2","original_commit_id":"bda0330c94bc05f7d5e2b119affe8af661ff3ff2","user":{"login":"arothuis","id":3816591,"avatar_url":"https://avatars.githubusercontent.com/u/3816591?v=3","gravatar_id":"","url":"https://api.github.com/users/arothuis","html_url":"https://github.com/arothuis","followers_url":"https://api.github.com/users/arothuis/followers","following_url":"https://api.github.com/users/arothuis/following{/other_user}","gists_url":"https://api.github.com/users/arothuis/gists{/gist_id}","starred_url":"https://api.github.com/users/arothuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arothuis/subscriptions","organizations_url":"https://api.github.com/users/arothuis/orgs","repos_url":"https://api.github.com/users/arothuis/repos","events_url":"https://api.github.com/users/arothuis/events{/privacy}","received_events_url":"https://api.github.com/users/arothuis/received_events","type":"User","site_admin":false},"body":"This is actually the same behaviour as a Projector, yet it would be inaccurate to call these EventListeners projectors as they don't project anything.\r\n\r\nThis behaviour could be abstracted away to an abstract `EventListener` class that gets extended by implementations. That can be done now or whenever there is another EventListener added.","created_at":"2016-07-13T15:07:34Z","updated_at":"2016-07-13T15:07:34Z","html_url":"https://github.com/SURFnet/Stepup-Middleware/pull/137#discussion_r70643969","pull_request_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/comments/70643969"},"html":{"href":"https://github.com/SURFnet/Stepup-Middleware/pull/137#discussion_r70643969"},"pull_request":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137","id":77305170,"html_url":"https://github.com/SURFnet/Stepup-Middleware/pull/137","diff_url":"https://github.com/SURFnet/Stepup-Middleware/pull/137.diff","patch_url":"https://github.com/SURFnet/Stepup-Middleware/pull/137.patch","issue_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/137","number":137,"state":"open","locked":false,"title":"Events creating institution configurations","user":{"login":"arothuis","id":3816591,"avatar_url":"https://avatars.githubusercontent.com/u/3816591?v=3","gravatar_id":"","url":"https://api.github.com/users/arothuis","html_url":"https://github.com/arothuis","followers_url":"https://api.github.com/users/arothuis/followers","following_url":"https://api.github.com/users/arothuis/following{/other_user}","gists_url":"https://api.github.com/users/arothuis/gists{/gist_id}","starred_url":"https://api.github.com/users/arothuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arothuis/subscriptions","organizations_url":"https://api.github.com/users/arothuis/orgs","repos_url":"https://api.github.com/users/arothuis/repos","events_url":"https://api.github.com/users/arothuis/events{/privacy}","received_events_url":"https://api.github.com/users/arothuis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-13T15:03:03Z","updated_at":"2016-07-13T15:07:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"235ae8177e819a09c254dae51f322b1f7d4752ab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137/commits","review_comments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137/comments","review_comment_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/137/comments","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/statuses/bda0330c94bc05f7d5e2b119affe8af661ff3ff2","head":{"label":"SURFnet:feature/events-creating-institution-configurations","ref":"feature/events-creating-institution-configurations","sha":"bda0330c94bc05f7d5e2b119affe8af661ff3ff2","user":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"repo":{"id":23867318,"name":"Stepup-Middleware","full_name":"SURFnet/Stepup-Middleware","owner":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SURFnet/Stepup-Middleware","description":"","fork":false,"url":"https://api.github.com/repos/SURFnet/Stepup-Middleware","forks_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/forks","keys_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/teams","hooks_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/hooks","issue_events_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/events{/number}","events_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/events","assignees_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/assignees{/user}","branches_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/branches{/branch}","tags_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/tags","blobs_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/languages","stargazers_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/stargazers","contributors_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/contributors","subscribers_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/subscribers","subscription_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/subscription","commits_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/contents/{+path}","compare_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/merges","archive_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/downloads","issues_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues{/number}","pulls_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/labels{/name}","releases_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/releases{/id}","deployments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/deployments","created_at":"2014-09-10T08:47:14Z","updated_at":"2016-02-19T13:15:31Z","pushed_at":"2016-07-13T15:03:04Z","git_url":"git://github.com/SURFnet/Stepup-Middleware.git","ssh_url":"git@github.com:SURFnet/Stepup-Middleware.git","clone_url":"https://github.com/SURFnet/Stepup-Middleware.git","svn_url":"https://github.com/SURFnet/Stepup-Middleware","homepage":null,"size":1797,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"develop"}},"base":{"label":"SURFnet:develop","ref":"develop","sha":"09774dba51f5045a156e1ae8f3c502377fce1b43","user":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"repo":{"id":23867318,"name":"Stepup-Middleware","full_name":"SURFnet/Stepup-Middleware","owner":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SURFnet/Stepup-Middleware","description":"","fork":false,"url":"https://api.github.com/repos/SURFnet/Stepup-Middleware","forks_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/forks","keys_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/teams","hooks_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/hooks","issue_events_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/events{/number}","events_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/events","assignees_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/assignees{/user}","branches_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/branches{/branch}","tags_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/tags","blobs_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/languages","stargazers_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/stargazers","contributors_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/contributors","subscribers_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/subscribers","subscription_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/subscription","commits_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/contents/{+path}","compare_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/merges","archive_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/downloads","issues_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues{/number}","pulls_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/labels{/name}","releases_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/releases{/id}","deployments_url":"https://api.github.com/repos/SURFnet/Stepup-Middleware/deployments","created_at":"2014-09-10T08:47:14Z","updated_at":"2016-02-19T13:15:31Z","pushed_at":"2016-07-13T15:03:04Z","git_url":"git://github.com/SURFnet/Stepup-Middleware.git","ssh_url":"git@github.com:SURFnet/Stepup-Middleware.git","clone_url":"https://github.com/SURFnet/Stepup-Middleware.git","svn_url":"https://github.com/SURFnet/Stepup-Middleware","homepage":null,"size":1797,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137"},"html":{"href":"https://github.com/SURFnet/Stepup-Middleware/pull/137"},"issue":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/137"},"comments":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/SURFnet/Stepup-Middleware/statuses/bda0330c94bc05f7d5e2b119affe8af661ff3ff2"}}}}
{"actor":{"display_login":"arothuis"}}