Skip to content

Commit 5f280f2

Browse files
committed
Merge branch 'hotfix/application-should-use-route-middleware-service' into release-3.0.0
Close zendframework#556
2 parents bf4a4f8 + d0b451e commit 5f280f2

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 3.0.0alpha7 - 2018-02-14
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- [#556](https://github.com/zendframework/zend-expressive/pull/556) modifies the
14+
`ApplicationFactory` such that it now uses the
15+
`Zend\Expressive\ROUTE_MIDDLEWARE` constant in order to retrieve the
16+
`Zend\Expressive\Router\Middleware\PathBasedRoutingMiddleware` instance.
17+
This is done to help smooth upgrades from v2 to v3, as it prevents a manual
18+
step when updating the `config/pipeline.php`, and ensures that the instance
19+
composed in the application is the same instance piped to the application.
20+
21+
### Deprecated
22+
23+
- Nothing.
24+
25+
### Removed
26+
27+
- Nothing.
28+
29+
### Fixed
30+
31+
- Nothing.
32+
533
## 3.0.0alpha6 - 2018-02-14
634

735
### Added

src/Container/ApplicationFactory.php

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

18+
use const Zend\Expressive\ROUTE_MIDDLEWARE;
19+
1920
/**
2021
* Create an Application instance.
2122
*
@@ -35,7 +36,7 @@ public function __invoke(ContainerInterface $container) : Application
3536
return new Application(
3637
$container->get(MiddlewareFactory::class),
3738
$container->get(ApplicationPipeline::class),
38-
$container->get(PathBasedRoutingMiddleware::class),
39+
$container->get(ROUTE_MIDDLEWARE),
3940
$container->get(RequestHandlerRunner::class)
4041
);
4142
}

src/constants.php

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

test/Container/ApplicationFactoryTest.php

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

22+
use const Zend\Expressive\ROUTE_MIDDLEWARE;
23+
2224
class ApplicationFactoryTest extends TestCase
2325
{
2426
public function testFactoryProducesAnApplication()
@@ -31,7 +33,7 @@ public function testFactoryProducesAnApplication()
3133
$container = $this->prophesize(ContainerInterface::class);
3234
$container->get(MiddlewareFactory::class)->willReturn($middlewareFactory);
3335
$container->get(ApplicationPipeline::class)->willReturn($pipeline);
34-
$container->get(PathBasedRoutingMiddleware::class)->willReturn($routeMiddleware);
36+
$container->get(ROUTE_MIDDLEWARE)->willReturn($routeMiddleware);
3537
$container->get(RequestHandlerRunner::class)->willReturn($runner);
3638

3739
$factory = new ApplicationFactory();

0 commit comments

Comments
 (0)