Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f47a912

Browse files
committed
Merge branch 'hotfix/dispatch-middleware-constant' into release-3.0.0
Close #559
2 parents f1b80f1 + 4230d06 commit f47a912

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ All notable changes to this project will be documented in this file, in reverse
1010

1111
### Changed
1212

13-
- Nothing.
13+
- [#559](https://github.com/zendframework/zend-expressive/pull/559) reverts the
14+
changes performed for [#556](https://github.com/zendframework/zend-expressive/pull/556)
15+
to the `ApplicationFactory`. It now uses the canonical service name for the
16+
`PathBasedRoutingMiddleware` instead of the `ROUTE_MIDDLEWARE` constant.
1417

1518
### Deprecated
1619

src/Container/ApplicationFactory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
use Zend\Expressive\Application;
1414
use Zend\Expressive\ApplicationPipeline;
1515
use Zend\Expressive\MiddlewareFactory;
16+
use Zend\Expressive\Router\Middleware\PathBasedRoutingMiddleware;
1617
use Zend\HttpHandlerRunner\RequestHandlerRunner;
1718

18-
use const Zend\Expressive\ROUTE_MIDDLEWARE;
19-
2019
/**
2120
* Create an Application instance.
2221
*
@@ -36,7 +35,7 @@ public function __invoke(ContainerInterface $container) : Application
3635
return new Application(
3736
$container->get(MiddlewareFactory::class),
3837
$container->get(ApplicationPipeline::class),
39-
$container->get(ROUTE_MIDDLEWARE),
38+
$container->get(PathBasedRoutingMiddleware::class),
4039
$container->get(RequestHandlerRunner::class)
4140
);
4241
}

src/constants.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
* Should resolve to the Zend\Expressive\Router\Middleware\PathBasedRoutingMiddleware
7171
* service.
7272
*
73+
* @deprecated To remove in version 4.0.0.
7374
* @var string
7475
*/
7576
const ROUTE_MIDDLEWARE = __NAMESPACE__ . '\Middleware\RouteMiddleware';

test/Container/ApplicationFactoryTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
use Zend\HttpHandlerRunner\RequestHandlerRunner;
2020
use Zend\Stratigility\MiddlewarePipeInterface;
2121

22-
use const Zend\Expressive\ROUTE_MIDDLEWARE;
23-
2422
class ApplicationFactoryTest extends TestCase
2523
{
2624
public function testFactoryProducesAnApplication()
@@ -33,7 +31,7 @@ public function testFactoryProducesAnApplication()
3331
$container = $this->prophesize(ContainerInterface::class);
3432
$container->get(MiddlewareFactory::class)->willReturn($middlewareFactory);
3533
$container->get(ApplicationPipeline::class)->willReturn($pipeline);
36-
$container->get(ROUTE_MIDDLEWARE)->willReturn($routeMiddleware);
34+
$container->get(PathBasedRoutingMiddleware::class)->willReturn($routeMiddleware);
3735
$container->get(RequestHandlerRunner::class)->willReturn($runner);
3836

3937
$factory = new ApplicationFactory();

0 commit comments

Comments
 (0)