@@ -298,20 +298,20 @@ This would be rewritten to the following to work with RC6 and later:
298298``` php
299299return [
300300 'middleware_pipeline' => [
301- [
301+ 'always' => [
302302 'middleware' => [
303303 Zend\Expressive\Helper\ServerUrlMiddleware::class,
304304 DebugToolbarMiddleware::class,
305305 ],
306306 'priority' => PHP_INT_MAX,
307307 ],
308- [
308+ 'api' => [
309309 'middleware' => ApiMiddleware::class,
310310 'path' => '/api,
311311 'priority' => 100,
312312 ],
313313
314- [
314+ 'routing' => [
315315 'middleware' => [
316316 Zend\Expressive\Container\ApplicationFactory::ROUTING_MIDDLEWARE,
317317 Zend\Expressive\Helper\UrlHelperMiddleware::class,
@@ -320,7 +320,7 @@ return [
320320 'priority' => 1,
321321 ],
322322
323- [
323+ 'error' => [
324324 'middleware' => [
325325 NotFoundMiddleware::class,
326326 ],
@@ -336,6 +336,16 @@ priority, you can simplify adding new middleware, particularly if you know it
336336should execute before routing, or as error middleware, or between routing and
337337dispatch.
338338
339+ > #### Keys are ignored
340+ >
341+ > The above example provides keys for each middleware specification. The factory
342+ > will ignore these, but they can be useful for cases when you might want to
343+ > specify configuration in multiple files, and merge specific entries together.
344+ > Be aware, however, that the ` middleware ` key itself is an indexed array;
345+ > items will be appended based on the order in which configuration files are
346+ > merged. If order of these is important, create separate specifications with
347+ > relevant ` priority ` values.
348+
339349## Route result observer deprecation
340350
341351As of RC6, the following changes have occurred with regards to route result
@@ -378,7 +388,7 @@ however, you will need to register it following the routing middleware:
378388[
379389 'middleware_pipeline' => [
380390 /* ... */
381- [
391+ 'routing' => [
382392 'middleware' => [
383393 Zend\Expressive\Container\ApplicationFactory::ROUTING_MIDDLEWARE,
384394 Zend\Expressive\Container\ApplicationFactory::ROUTE_RESULT_OBSERVER_MIDDLEWARE,
@@ -460,7 +470,7 @@ If you are using the `ApplicationFactory`, alter your configuration:
460470[
461471 'middleware_pipeline' => [
462472 /* ... */
463- [
473+ 'routing' => [
464474 'middleware' => [
465475 Zend\Expressive\Container\ApplicationFactory::ROUTING_MIDDLEWARE,
466476 ['middleware' => MyObserver::class],
0 commit comments