{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/comments/49801504","id":49801504,"diff_hunk":"@@ -74,11 +74,9 @@ return [\n         ],\n     ],\n     'middleware_pipeline' => [\n-        'pre_routing' => [\n-            [\n-                'middleware' => [\n-                    PhpDebugBarMiddleware::class,\n-                ],\n+        [\n+            'middleware' => [\n+                PhpDebugBarMiddleware::class,\n             ],","path":"doc/book/cookbook/debug-toolbars.md","position":12,"original_position":12,"commit_id":"913337b3335ee0cb9adad1aa7d3899d494784ed4","original_commit_id":"913337b3335ee0cb9adad1aa7d3899d494784ed4","user":{"login":"danizord","id":1850941,"avatar_url":"https://avatars.githubusercontent.com/u/1850941?v=3","gravatar_id":"","url":"https://api.github.com/users/danizord","html_url":"https://github.com/danizord","followers_url":"https://api.github.com/users/danizord/followers","following_url":"https://api.github.com/users/danizord/following{/other_user}","gists_url":"https://api.github.com/users/danizord/gists{/gist_id}","starred_url":"https://api.github.com/users/danizord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danizord/subscriptions","organizations_url":"https://api.github.com/users/danizord/orgs","repos_url":"https://api.github.com/users/danizord/repos","events_url":"https://api.github.com/users/danizord/events{/privacy}","received_events_url":"https://api.github.com/users/danizord/received_events","type":"User","site_admin":false},"body":"Should have routing and dispatch middlewares here to illustrate that `PhpDebugBarMiddleware::class` must be piped before them?","created_at":"2016-01-14T23:25:15Z","updated_at":"2016-01-14T23:25:15Z","html_url":"https://github.com/zendframework/zend-expressive/pull/270#discussion_r49801504","pull_request_url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/comments/49801504"},"html":{"href":"https://github.com/zendframework/zend-expressive/pull/270#discussion_r49801504"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270","id":56053776,"html_url":"https://github.com/zendframework/zend-expressive/pull/270","diff_url":"https://github.com/zendframework/zend-expressive/pull/270.diff","patch_url":"https://github.com/zendframework/zend-expressive/pull/270.patch","issue_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/270","number":270,"state":"open","locked":false,"title":"Simplify the middleware pipeline configuration","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":"This patch simplifies a number of features of Expressive:\r\n\r\n- It simplifies the middleware pipeline configuration, by removing the `pre_routing` and `post_routing` keys; all middleware is piped at the same level of configuration, including routing.\r\n- It splits the routing middleware into distinct routing and dispatch middleware. This allows replacing either process. This necessitates removal of autoregistration of the routing middleware; I consider this a *feature*, however, as it also ensures that you can form the middleware pipeline independent of when routes are added to the application.\r\n- Because of the above, this patch also deprecates the route result observer system, as it's redundant. You can create \"route result observers\" as middleware that introspects the route result (which is injected as a request attribute following routing), and inject it in the pipeline immediately following the routing middleware. This simplifies route result observer registration as well, by providing exactly one way to accomplish it, and doing it in a portable fashion (middleware!).\r\n\r\nI've noticed one potential issue with the change: configuration merging with indexed arrays means that we cannot guarantee order. This will potentially lead to issues if the `middleware_pipeline` is defined in multiple configuration files. I'm working on a solution that will likely utilize priority or order keys in the middleware spec arrays.\r\n\r\n## TODO\r\n\r\n- [x] deprecate pre/post routing keys\r\n- [x] remove auto-registration of routing middleware\r\n- [x] split routing middleware into routing + dispatch middleware\r\n- [x] deprecate route result observers\r\n- [ ] update flow diagram\r\n- [ ] solve middleware_pipeline ordering issues post-merge (implement priority/order key)","created_at":"2016-01-14T15:58:30Z","updated_at":"2016-01-14T23:25:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2b86d4f2a7c1f4851c25be6b7d778e2a0a142c7","assignee":null,"milestone":{"url":"https://api.github.com/repos/zendframework/zend-expressive/milestones/14","html_url":"https://github.com/zendframework/zend-expressive/milestones/1.0.0","labels_url":"https://api.github.com/repos/zendframework/zend-expressive/milestones/14/labels","id":1479825,"number":14,"title":"1.0.0","description":null,"creator":{"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},"open_issues":1,"closed_issues":11,"state":"open","created_at":"2016-01-01T16:20:41Z","updated_at":"2016-01-14T15:59:27Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-expressive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/270/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-expressive/statuses/913337b3335ee0cb9adad1aa7d3899d494784ed4","head":{"label":"weierophinney:hotfix/pipeline-config","ref":"hotfix/pipeline-config","sha":"913337b3335ee0cb9adad1aa7d3899d494784ed4","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":40145470,"name":"zend-expressive","full_name":"weierophinney/zend-expressive","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-expressive","description":"Start to develop PSR-7 middleware applications in PHP in a minute!","fork":true,"url":"https://api.github.com/repos/weierophinney/zend-expressive","forks_url":"https://api.github.com/repos/weierophinney/zend-expressive/forks","keys_url":"https://api.github.com/repos/weierophinney/zend-expressive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weierophinney/zend-expressive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weierophinney/zend-expressive/teams","hooks_url":"https://api.github.com/repos/weierophinney/zend-expressive/hooks","issue_events_url":"https://api.github.com/repos/weierophinney/zend-expressive/issues/events{/number}","events_url":"https://api.github.com/repos/weierophinney/zend-expressive/events","assignees_url":"https://api.github.com/repos/weierophinney/zend-expressive/assignees{/user}","branches_url":"https://api.github.com/repos/weierophinney/zend-expressive/branches{/branch}","tags_url":"https://api.github.com/repos/weierophinney/zend-expressive/tags","blobs_url":"https://api.github.com/repos/weierophinney/zend-expressive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weierophinney/zend-expressive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weierophinney/zend-expressive/git/refs{/sha}","trees_url":"https://api.github.com/repos/weierophinney/zend-expressive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weierophinney/zend-expressive/statuses/{sha}","languages_url":"https://api.github.com/repos/weierophinney/zend-expressive/languages","stargazers_url":"https://api.github.com/repos/weierophinney/zend-expressive/stargazers","contributors_url":"https://api.github.com/repos/weierophinney/zend-expressive/contributors","subscribers_url":"https://api.github.com/repos/weierophinney/zend-expressive/subscribers","subscription_url":"https://api.github.com/repos/weierophinney/zend-expressive/subscription","commits_url":"https://api.github.com/repos/weierophinney/zend-expressive/commits{/sha}","git_commits_url":"https://api.github.com/repos/weierophinney/zend-expressive/git/commits{/sha}","comments_url":"https://api.github.com/repos/weierophinney/zend-expressive/comments{/number}","issue_comment_url":"https://api.github.com/repos/weierophinney/zend-expressive/issues/comments{/number}","contents_url":"https://api.github.com/repos/weierophinney/zend-expressive/contents/{+path}","compare_url":"https://api.github.com/repos/weierophinney/zend-expressive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weierophinney/zend-expressive/merges","archive_url":"https://api.github.com/repos/weierophinney/zend-expressive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weierophinney/zend-expressive/downloads","issues_url":"https://api.github.com/repos/weierophinney/zend-expressive/issues{/number}","pulls_url":"https://api.github.com/repos/weierophinney/zend-expressive/pulls{/number}","milestones_url":"https://api.github.com/repos/weierophinney/zend-expressive/milestones{/number}","notifications_url":"https://api.github.com/repos/weierophinney/zend-expressive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weierophinney/zend-expressive/labels{/name}","releases_url":"https://api.github.com/repos/weierophinney/zend-expressive/releases{/id}","created_at":"2015-08-03T20:06:05Z","updated_at":"2015-08-03T20:06:06Z","pushed_at":"2016-01-14T23:16:13Z","git_url":"git://github.com/weierophinney/zend-expressive.git","ssh_url":"git@github.com:weierophinney/zend-expressive.git","clone_url":"https://github.com/weierophinney/zend-expressive.git","svn_url":"https://github.com/weierophinney/zend-expressive","homepage":null,"size":883,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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:master","ref":"master","sha":"501adde2f6b9255eb8873e49d128e72b9c97874d","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":40017341,"name":"zend-expressive","full_name":"zendframework/zend-expressive","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-expressive","description":"Start to develop PSR-7 middleware applications in PHP in a minute!","fork":false,"url":"https://api.github.com/repos/zendframework/zend-expressive","forks_url":"https://api.github.com/repos/zendframework/zend-expressive/forks","keys_url":"https://api.github.com/repos/zendframework/zend-expressive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-expressive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-expressive/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-expressive/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-expressive/events","assignees_url":"https://api.github.com/repos/zendframework/zend-expressive/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-expressive/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-expressive/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-expressive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-expressive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-expressive/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-expressive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-expressive/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-expressive/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-expressive/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-expressive/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-expressive/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-expressive/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-expressive/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-expressive/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-expressive/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-expressive/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-expressive/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-expressive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-expressive/merges","archive_url":"https://api.github.com/repos/zendframework/zend-expressive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-expressive/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-expressive/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-expressive/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-expressive/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-expressive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-expressive/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-expressive/releases{/id}","created_at":"2015-07-31T17:45:22Z","updated_at":"2016-01-14T09:39:11Z","pushed_at":"2016-01-14T23:16:19Z","git_url":"git://github.com/zendframework/zend-expressive.git","ssh_url":"git@github.com:zendframework/zend-expressive.git","clone_url":"https://github.com/zendframework/zend-expressive.git","svn_url":"https://github.com/zendframework/zend-expressive","homepage":null,"size":964,"stargazers_count":244,"watchers_count":244,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":10,"forks":53,"open_issues":10,"watchers":244,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270"},"html":{"href":"https://github.com/zendframework/zend-expressive/pull/270"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-expressive/issues/270"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-expressive/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-expressive/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-expressive/statuses/913337b3335ee0cb9adad1aa7d3899d494784ed4"}}}}