Skip to content

Commit 30730cf

Browse files
authored
Merge pull request #267 from symfony-cmf/cleanup-interfaces
The RouterInterface is included in the ChainedRouterInterface
2 parents ea6fb2c + da6ecc6 commit 30730cf

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/DynamicRouter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Symfony\Component\Routing\RequestContextAwareInterface;
2828
use Symfony\Component\Routing\Route;
2929
use Symfony\Component\Routing\RouteCollection;
30-
use Symfony\Component\Routing\RouterInterface;
3130

3231
/**
3332
* A flexible router accepting matcher and generator through injection and
@@ -36,7 +35,7 @@
3635
* @author Larry Garfield
3736
* @author David Buchmann
3837
*/
39-
class DynamicRouter implements RouterInterface, RequestMatcherInterface, ChainedRouterInterface
38+
class DynamicRouter implements RequestMatcherInterface, ChainedRouterInterface
4039
{
4140
use RouteEnhancerTrait;
4241

src/Event/RouterMatchEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(Request $request = null)
3030
}
3131

3232
/**
33-
* @return Request | null
33+
* @return Request|null
3434
*/
3535
public function getRequest()
3636
{

tests/Unit/Routing/ChainRouterTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,19 @@ public function testMatchRequestNotFound()
476476
public function testMatchWithRequestMatchersNotFound()
477477
{
478478
$url = '/test';
479-
$request = Request::create('/test');
479+
$expected = Request::create('/test');
480+
$expected->server->remove('REQUEST_TIME_FLOAT');
480481

481482
$high = $this->createMock(RequestMatcher::class);
482483

483484
$high
484485
->expects($this->once())
485486
->method('matchRequest')
486-
->with($request)
487+
->with($this->callback(function (Request $actual) use ($expected): bool {
488+
$actual->server->remove('REQUEST_TIME_FLOAT');
489+
490+
return $actual == $expected;
491+
}))
487492
->will($this->throwException(new ResourceNotFoundException()))
488493
;
489494

0 commit comments

Comments
 (0)