{"action":"created","comment":{"url":"https://api.github.com/repos/sparkphp/Spark/pulls/comments/32594729","id":32594729,"diff_hunk":"@@ -289,4 +218,34 @@ public function getConfig($key, $default = null)\n     {\n         return isset($this->config[$key]) ? $this->config[$key] : $default;\n     }\n+    /**\n+     * Add application wide middleware\n+     *\n+     * @param array $middleware\n+     */\n+    public function addMiddleware($middleware)\n+    {\n+        $this->middleware[] = $middleware;\n+    }\n+\n+    /**\n+     * Sets middleware stack for the application.\n+     *\n+     * @param callable $func\n+     */\n+    public function setMiddleware(callable $func)\n+    {\n+        $this->middleware = $func();","path":"src/Application.php","position":224,"original_position":224,"commit_id":"fc4d9b50e3c2a7f2d928852047d4cb6a9e9541c8","original_commit_id":"fc4d9b50e3c2a7f2d928852047d4cb6a9e9541c8","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":"Yeah, I don't like it much. Just setting an array would be better.","created_at":"2015-06-17T04:32:47Z","updated_at":"2015-06-17T04:32:47Z","html_url":"https://github.com/sparkphp/Spark/pull/17#discussion_r32594729","pull_request_url":"https://api.github.com/repos/sparkphp/Spark/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/comments/32594729"},"html":{"href":"https://github.com/sparkphp/Spark/pull/17#discussion_r32594729"},"pull_request":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/sparkphp/Spark/pulls/17","id":37755233,"html_url":"https://github.com/sparkphp/Spark/pull/17","diff_url":"https://github.com/sparkphp/Spark/pull/17.diff","patch_url":"https://github.com/sparkphp/Spark/pull/17.patch","issue_url":"https://api.github.com/repos/sparkphp/Spark/issues/17","number":17,"state":"open","locked":false,"title":"Add Relay Middleware","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":"Small beginnings... @ameech @shadowhand \r\n\r\nIncludes ExceptionHandler, RouteHandler, and ActionHandler middleware.","created_at":"2015-06-16T02:50:41Z","updated_at":"2015-06-17T04:32:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe66b7b2205aab961ea968f0ce40bdf8ccad9eaa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sparkphp/Spark/pulls/17/commits","review_comments_url":"https://api.github.com/repos/sparkphp/Spark/pulls/17/comments","review_comment_url":"https://api.github.com/repos/sparkphp/Spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sparkphp/Spark/issues/17/comments","statuses_url":"https://api.github.com/repos/sparkphp/Spark/statuses/fc4d9b50e3c2a7f2d928852047d4cb6a9e9541c8","head":{"label":"sparkphp:feature/middleware-relay","ref":"feature/middleware-relay","sha":"fc4d9b50e3c2a7f2d928852047d4cb6a9e9541c8","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-06-16T22:06:24Z","pushed_at":"2015-06-16T21:40:40Z","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":"http://sparkphp.github.io","size":408,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"base":{"label":"sparkphp:master","ref":"master","sha":"b17e562ea22ac1a0f93720b2d13edfadc1cee40a","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-06-16T22:06:24Z","pushed_at":"2015-06-16T21:40:40Z","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":"http://sparkphp.github.io","size":408,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/17"},"html":{"href":"https://github.com/sparkphp/Spark/pull/17"},"issue":{"href":"https://api.github.com/repos/sparkphp/Spark/issues/17"},"comments":{"href":"https://api.github.com/repos/sparkphp/Spark/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sparkphp/Spark/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/sparkphp/Spark/statuses/fc4d9b50e3c2a7f2d928852047d4cb6a9e9541c8"}}}}