Skip to content

Commit e4aed14

Browse files
authored
Update yiisoft/middleware-dispatcher version to 5.0 (#185)
* Update `yiisoft/middleware-dispatcher` version to 5.0 * Add changelog
1 parent 75b086a commit e4aed14

File tree

7 files changed

+12
-18
lines changed

7 files changed

+12
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Yii Router Change Log
22

3-
## 2.0.1 under development
3+
## 2.1.0 under development
44

5-
- no changes in this release.
5+
- Chg #185: Update `yiisoft/middleware-dispatcher` version to `^5.0` (@rustamwin)
66

77
## 2.0.0 November 12, 2022
88

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"psr/http-server-handler": "^1.0",
2626
"psr/http-server-middleware": "^1.0",
2727
"yiisoft/http": "^1.2",
28-
"yiisoft/middleware-dispatcher": "^3.0|^4.0",
28+
"yiisoft/middleware-dispatcher": "^5.0",
2929
"yiisoft/router-implementation": "1.0.0"
3030
},
3131
"require-dev": {

tests/GroupTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use RuntimeException;
1616
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
1717
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;
18-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
1918
use Yiisoft\Router\Group;
2019
use Yiisoft\Router\Route;
2120
use Yiisoft\Router\RouteCollection;
@@ -421,7 +420,7 @@ public function testImmutability(): void
421420
{
422421
$container = new SimpleContainer();
423422
$middlewareDispatcher = new MiddlewareDispatcher(
424-
new MiddlewareFactory($container, new WrapperFactory($container)),
423+
new MiddlewareFactory($container),
425424
);
426425

427426
$group = Group::create();
@@ -449,9 +448,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
449448
private function getDispatcher(): MiddlewareDispatcher
450449
{
451450
$container = new Container([]);
452-
$wrapperFactory = new WrapperFactory($container);
453451
return new MiddlewareDispatcher(
454-
new MiddlewareFactory($container, $wrapperFactory),
452+
new MiddlewareFactory($container),
455453
$this->createMock(EventDispatcherInterface::class)
456454
);
457455
}

tests/MatchingResultTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Yiisoft\Http\Method;
1717
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
1818
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;
19-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
2019
use Yiisoft\Router\MatchingResult;
2120
use Yiisoft\Router\Route;
2221
use Yiisoft\Test\Support\Container\SimpleContainer;
@@ -53,7 +52,7 @@ public function testProcessSuccess(): void
5352
{
5453
$container = $this->createMock(ContainerInterface::class);
5554
$dispatcher = new MiddlewareDispatcher(
56-
new MiddlewareFactory($container, new WrapperFactory($container)),
55+
new MiddlewareFactory($container),
5756
$this->createMock(EventDispatcherInterface::class)
5857
);
5958
$route = Route::post('/', $dispatcher)->middleware($this->getMiddleware());
@@ -87,7 +86,7 @@ public function testImmutability(): void
8786
{
8887
$container = new SimpleContainer();
8988
$middlewareDispatcher = new MiddlewareDispatcher(
90-
new MiddlewareFactory($container, new WrapperFactory($container)),
89+
new MiddlewareFactory($container),
9190
);
9291

9392
$result = MatchingResult::fromFailure([Method::GET]);

tests/Middleware/RouterTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Http\Server\RequestHandlerInterface;
1515
use Yiisoft\Http\Method;
1616
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;
17-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
1817
use Yiisoft\Router\CurrentRoute;
1918
use Yiisoft\Router\Group;
2019
use Yiisoft\Router\MatchingResult;
@@ -199,7 +198,7 @@ private function createRouterMiddleware(
199198
return new Router(
200199
$this->getMatcher($routeCollection),
201200
new Psr17Factory(),
202-
new MiddlewareFactory($container, new WrapperFactory($container)),
201+
new MiddlewareFactory($container),
203202
$currentRoute ?? new CurrentRoute()
204203
);
205204
}

tests/RouteCollectionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use RuntimeException;
1616
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
1717
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;
18-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
1918
use Yiisoft\Router\Group;
2019
use Yiisoft\Router\Route;
2120
use Yiisoft\Router\RouteCollection;
@@ -385,7 +384,7 @@ private function getDispatcher(ContainerInterface $container = null): Middleware
385384
{
386385
$container ??= $this->createMock(ContainerInterface::class);
387386
return new MiddlewareDispatcher(
388-
new MiddlewareFactory($container, new WrapperFactory($container)),
387+
new MiddlewareFactory($container),
389388
$this->createMock(EventDispatcherInterface::class)
390389
);
391390
}

tests/RouteTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Yiisoft\Http\Method;
1717
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
1818
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;
19-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
2019
use Yiisoft\Router\Route;
2120
use Yiisoft\Router\Tests\Support\AssertTrait;
2221
use Yiisoft\Router\Tests\Support\Container;
@@ -402,7 +401,7 @@ public function testImmutability(): void
402401
{
403402
$container = new SimpleContainer();
404403
$middlewareDispatcher = new MiddlewareDispatcher(
405-
new MiddlewareFactory($container, new WrapperFactory($container)),
404+
new MiddlewareFactory($container),
406405
);
407406

408407
$route = Route::get('/');
@@ -435,13 +434,13 @@ private function getDispatcher(ContainerInterface $container = null): Middleware
435434
{
436435
if ($container === null) {
437436
return new MiddlewareDispatcher(
438-
new MiddlewareFactory($this->getContainer(), new WrapperFactory($this->getContainer())),
437+
new MiddlewareFactory($this->getContainer()),
439438
$this->createMock(EventDispatcherInterface::class)
440439
);
441440
}
442441

443442
return new MiddlewareDispatcher(
444-
new MiddlewareFactory($container, new WrapperFactory($container)),
443+
new MiddlewareFactory($container),
445444
$this->createMock(EventDispatcherInterface::class)
446445
);
447446
}

0 commit comments

Comments
 (0)