{"action":"created","comment":{"url":"https://api.github.com/repos/sparkphp/Spark/pulls/comments/30992512","id":30992512,"diff_hunk":"@@ -0,0 +1,58 @@\n+<?php\n+namespace Spark\\Handler;\n+\n+use Aura\\Payload_Interface\\PayloadInterface;\n+use Auryn\\Injector;\n+use Psr\\Http\\Message\\ResponseInterface;\n+use Psr\\Http\\Message\\ServerRequestInterface;\n+use Spark\\Adr\\DomainInterface;\n+use Spark\\Adr\\InputInterface;\n+use Spark\\Adr\\ResponderInterface;\n+use Spark\\Adr\\RouteInterface;\n+use Spark\\Router;\n+\n+class ActionHandler\n+{\n+    protected $injector;\n+    protected $router;\n+\n+    public function __construct(Injector $injector, Router $router)\n+    {\n+        $this->injector = $injector;\n+        $this->router = $router;\n+    }\n+\n+    public function __invoke(\n+        ServerRequestInterface $request,\n+        ResponseInterface $response,\n+        RouteInterface $route\n+    ) {\n+\n+        /**\n+         * @var $responder callable\n+         */\n+        $responder = $this->injector->make($route->getResponder() ?: $this->router->getResponder());\n+        $payload = null;\n+        if ($route->getDomain()) {\n+            $domain = $this->injector->make($route->getDomain());","path":"src/Handler/ActionHandler.php","position":37,"original_position":37,"commit_id":"579800f4c16797b403ee5b63626f85a3d22f5eea","original_commit_id":"579800f4c16797b403ee5b63626f85a3d22f5eea","user":{"login":"dolfelt","id":202546,"avatar_url":"https://avatars.githubusercontent.com/u/202546?v=3","gravatar_id":"","url":"https://api.github.com/users/dolfelt","html_url":"https://github.com/dolfelt","followers_url":"https://api.github.com/users/dolfelt/followers","following_url":"https://api.github.com/users/dolfelt/following{/other_user}","gists_url":"https://api.github.com/users/dolfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/dolfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolfelt/subscriptions","organizations_url":"https://api.github.com/users/dolfelt/orgs","repos_url":"https://api.github.com/users/dolfelt/repos","events_url":"https://api.github.com/users/dolfelt/events{/privacy}","received_events_url":"https://api.github.com/users/dolfelt/received_events","type":"User","site_admin":false},"body":"@shadowhand But the route doesn't accept the `Injector`, so how are the instances created? I see that you typed the `getDomain` to return a `DomainInterface`, but I don't see where it is initialized. I think making sure we only `make` one `DomainInstance` is key, and having the route object do it doesn't make sense in that case.","created_at":"2015-05-25T19:39:37Z","updated_at":"2015-05-25T19:39:37Z","html_url":"https://github.com/sparkphp/Spark/pull/1#discussion_r30992512","pull_request_url":"https://api.github.com/repos/sparkphp/Spark/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/comments/30992512"},"html":{"href":"https://github.com/sparkphp/Spark/pull/1#discussion_r30992512"},"pull_request":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sparkphp/Spark/pulls/1","id":36108676,"html_url":"https://github.com/sparkphp/Spark/pull/1","diff_url":"https://github.com/sparkphp/Spark/pull/1.diff","patch_url":"https://github.com/sparkphp/Spark/pull/1.patch","issue_url":"https://api.github.com/repos/sparkphp/Spark/issues/1","number":1,"state":"open","locked":false,"title":"Improved the flow through the ActionHandler.","user":{"login":"dolfelt","id":202546,"avatar_url":"https://avatars.githubusercontent.com/u/202546?v=3","gravatar_id":"","url":"https://api.github.com/users/dolfelt","html_url":"https://github.com/dolfelt","followers_url":"https://api.github.com/users/dolfelt/followers","following_url":"https://api.github.com/users/dolfelt/following{/other_user}","gists_url":"https://api.github.com/users/dolfelt/gists{/gist_id}","starred_url":"https://api.github.com/users/dolfelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolfelt/subscriptions","organizations_url":"https://api.github.com/users/dolfelt/orgs","repos_url":"https://api.github.com/users/dolfelt/repos","events_url":"https://api.github.com/users/dolfelt/events{/privacy}","received_events_url":"https://api.github.com/users/dolfelt/received_events","type":"User","site_admin":false},"body":"Thoughts @shadowhand?\r\n\r\nYou can comment too @ameech. :smiley: ","created_at":"2015-05-24T21:25:32Z","updated_at":"2015-05-25T19:39:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63f2fef3145bd3b716890d619237b84b9dec83ef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sparkphp/Spark/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sparkphp/Spark/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sparkphp/Spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sparkphp/Spark/issues/1/comments","statuses_url":"https://api.github.com/repos/sparkphp/Spark/statuses/579800f4c16797b403ee5b63626f85a3d22f5eea","head":{"label":"sparkphp:0.1.x","ref":"0.1.x","sha":"579800f4c16797b403ee5b63626f85a3d22f5eea","user":{"login":"sparkphp","id":12573848,"avatar_url":"https://avatars.githubusercontent.com/u/12573848?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkphp","html_url":"https://github.com/sparkphp","followers_url":"https://api.github.com/users/sparkphp/followers","following_url":"https://api.github.com/users/sparkphp/following{/other_user}","gists_url":"https://api.github.com/users/sparkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkphp/subscriptions","organizations_url":"https://api.github.com/users/sparkphp/orgs","repos_url":"https://api.github.com/users/sparkphp/repos","events_url":"https://api.github.com/users/sparkphp/events{/privacy}","received_events_url":"https://api.github.com/users/sparkphp/received_events","type":"Organization","site_admin":false},"repo":{"id":36032948,"name":"Spark","full_name":"sparkphp/Spark","owner":{"login":"sparkphp","id":12573848,"avatar_url":"https://avatars.githubusercontent.com/u/12573848?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkphp","html_url":"https://github.com/sparkphp","followers_url":"https://api.github.com/users/sparkphp/followers","following_url":"https://api.github.com/users/sparkphp/following{/other_user}","gists_url":"https://api.github.com/users/sparkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkphp/subscriptions","organizations_url":"https://api.github.com/users/sparkphp/orgs","repos_url":"https://api.github.com/users/sparkphp/repos","events_url":"https://api.github.com/users/sparkphp/events{/privacy}","received_events_url":"https://api.github.com/users/sparkphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sparkphp/Spark","description":"A tiny, yet powerful, PHP micro-framework.","fork":false,"url":"https://api.github.com/repos/sparkphp/Spark","forks_url":"https://api.github.com/repos/sparkphp/Spark/forks","keys_url":"https://api.github.com/repos/sparkphp/Spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sparkphp/Spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sparkphp/Spark/teams","hooks_url":"https://api.github.com/repos/sparkphp/Spark/hooks","issue_events_url":"https://api.github.com/repos/sparkphp/Spark/issues/events{/number}","events_url":"https://api.github.com/repos/sparkphp/Spark/events","assignees_url":"https://api.github.com/repos/sparkphp/Spark/assignees{/user}","branches_url":"https://api.github.com/repos/sparkphp/Spark/branches{/branch}","tags_url":"https://api.github.com/repos/sparkphp/Spark/tags","blobs_url":"https://api.github.com/repos/sparkphp/Spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sparkphp/Spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sparkphp/Spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/sparkphp/Spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sparkphp/Spark/statuses/{sha}","languages_url":"https://api.github.com/repos/sparkphp/Spark/languages","stargazers_url":"https://api.github.com/repos/sparkphp/Spark/stargazers","contributors_url":"https://api.github.com/repos/sparkphp/Spark/contributors","subscribers_url":"https://api.github.com/repos/sparkphp/Spark/subscribers","subscription_url":"https://api.github.com/repos/sparkphp/Spark/subscription","commits_url":"https://api.github.com/repos/sparkphp/Spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/sparkphp/Spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/sparkphp/Spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/sparkphp/Spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/sparkphp/Spark/contents/{+path}","compare_url":"https://api.github.com/repos/sparkphp/Spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sparkphp/Spark/merges","archive_url":"https://api.github.com/repos/sparkphp/Spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sparkphp/Spark/downloads","issues_url":"https://api.github.com/repos/sparkphp/Spark/issues{/number}","pulls_url":"https://api.github.com/repos/sparkphp/Spark/pulls{/number}","milestones_url":"https://api.github.com/repos/sparkphp/Spark/milestones{/number}","notifications_url":"https://api.github.com/repos/sparkphp/Spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sparkphp/Spark/labels{/name}","releases_url":"https://api.github.com/repos/sparkphp/Spark/releases{/id}","created_at":"2015-05-21T19:24:54Z","updated_at":"2015-05-25T14:42:28Z","pushed_at":"2015-05-25T19:20:27Z","git_url":"git://github.com/sparkphp/Spark.git","ssh_url":"git@github.com:sparkphp/Spark.git","clone_url":"https://github.com/sparkphp/Spark.git","svn_url":"https://github.com/sparkphp/Spark","homepage":null,"size":0,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"sparkphp:master","ref":"master","sha":"eaa209cc4091b0552dfa4e495d130816e325d2ac","user":{"login":"sparkphp","id":12573848,"avatar_url":"https://avatars.githubusercontent.com/u/12573848?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkphp","html_url":"https://github.com/sparkphp","followers_url":"https://api.github.com/users/sparkphp/followers","following_url":"https://api.github.com/users/sparkphp/following{/other_user}","gists_url":"https://api.github.com/users/sparkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkphp/subscriptions","organizations_url":"https://api.github.com/users/sparkphp/orgs","repos_url":"https://api.github.com/users/sparkphp/repos","events_url":"https://api.github.com/users/sparkphp/events{/privacy}","received_events_url":"https://api.github.com/users/sparkphp/received_events","type":"Organization","site_admin":false},"repo":{"id":36032948,"name":"Spark","full_name":"sparkphp/Spark","owner":{"login":"sparkphp","id":12573848,"avatar_url":"https://avatars.githubusercontent.com/u/12573848?v=3","gravatar_id":"","url":"https://api.github.com/users/sparkphp","html_url":"https://github.com/sparkphp","followers_url":"https://api.github.com/users/sparkphp/followers","following_url":"https://api.github.com/users/sparkphp/following{/other_user}","gists_url":"https://api.github.com/users/sparkphp/gists{/gist_id}","starred_url":"https://api.github.com/users/sparkphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparkphp/subscriptions","organizations_url":"https://api.github.com/users/sparkphp/orgs","repos_url":"https://api.github.com/users/sparkphp/repos","events_url":"https://api.github.com/users/sparkphp/events{/privacy}","received_events_url":"https://api.github.com/users/sparkphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sparkphp/Spark","description":"A tiny, yet powerful, PHP micro-framework.","fork":false,"url":"https://api.github.com/repos/sparkphp/Spark","forks_url":"https://api.github.com/repos/sparkphp/Spark/forks","keys_url":"https://api.github.com/repos/sparkphp/Spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sparkphp/Spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sparkphp/Spark/teams","hooks_url":"https://api.github.com/repos/sparkphp/Spark/hooks","issue_events_url":"https://api.github.com/repos/sparkphp/Spark/issues/events{/number}","events_url":"https://api.github.com/repos/sparkphp/Spark/events","assignees_url":"https://api.github.com/repos/sparkphp/Spark/assignees{/user}","branches_url":"https://api.github.com/repos/sparkphp/Spark/branches{/branch}","tags_url":"https://api.github.com/repos/sparkphp/Spark/tags","blobs_url":"https://api.github.com/repos/sparkphp/Spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sparkphp/Spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sparkphp/Spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/sparkphp/Spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sparkphp/Spark/statuses/{sha}","languages_url":"https://api.github.com/repos/sparkphp/Spark/languages","stargazers_url":"https://api.github.com/repos/sparkphp/Spark/stargazers","contributors_url":"https://api.github.com/repos/sparkphp/Spark/contributors","subscribers_url":"https://api.github.com/repos/sparkphp/Spark/subscribers","subscription_url":"https://api.github.com/repos/sparkphp/Spark/subscription","commits_url":"https://api.github.com/repos/sparkphp/Spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/sparkphp/Spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/sparkphp/Spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/sparkphp/Spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/sparkphp/Spark/contents/{+path}","compare_url":"https://api.github.com/repos/sparkphp/Spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sparkphp/Spark/merges","archive_url":"https://api.github.com/repos/sparkphp/Spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sparkphp/Spark/downloads","issues_url":"https://api.github.com/repos/sparkphp/Spark/issues{/number}","pulls_url":"https://api.github.com/repos/sparkphp/Spark/pulls{/number}","milestones_url":"https://api.github.com/repos/sparkphp/Spark/milestones{/number}","notifications_url":"https://api.github.com/repos/sparkphp/Spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sparkphp/Spark/labels{/name}","releases_url":"https://api.github.com/repos/sparkphp/Spark/releases{/id}","created_at":"2015-05-21T19:24:54Z","updated_at":"2015-05-25T14:42:28Z","pushed_at":"2015-05-25T19:20:27Z","git_url":"git://github.com/sparkphp/Spark.git","ssh_url":"git@github.com:sparkphp/Spark.git","clone_url":"https://github.com/sparkphp/Spark.git","svn_url":"https://github.com/sparkphp/Spark","homepage":null,"size":0,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/1"},"html":{"href":"https://github.com/sparkphp/Spark/pull/1"},"issue":{"href":"https://api.github.com/repos/sparkphp/Spark/issues/1"},"comments":{"href":"https://api.github.com/repos/sparkphp/Spark/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sparkphp/Spark/statuses/579800f4c16797b403ee5b63626f85a3d22f5eea"}}}}