Skip to content

Commit

Permalink
Merge pull request #267 from symfony-cmf/cleanup-interfaces
Browse files Browse the repository at this point in the history
The RouterInterface is included in the ChainedRouterInterface
  • Loading branch information
dbu authored Jun 17, 2021
2 parents ea6fb2c + da6ecc6 commit 30730cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/DynamicRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Symfony\Component\Routing\RequestContextAwareInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouterInterface;

/**
* A flexible router accepting matcher and generator through injection and
Expand All @@ -36,7 +35,7 @@
* @author Larry Garfield
* @author David Buchmann
*/
class DynamicRouter implements RouterInterface, RequestMatcherInterface, ChainedRouterInterface
class DynamicRouter implements RequestMatcherInterface, ChainedRouterInterface
{
use RouteEnhancerTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Event/RouterMatchEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Request $request = null)
}

/**
* @return Request | null
* @return Request|null
*/
public function getRequest()
{
Expand Down
9 changes: 7 additions & 2 deletions tests/Unit/Routing/ChainRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,19 @@ public function testMatchRequestNotFound()
public function testMatchWithRequestMatchersNotFound()
{
$url = '/test';
$request = Request::create('/test');
$expected = Request::create('/test');
$expected->server->remove('REQUEST_TIME_FLOAT');

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

$high
->expects($this->once())
->method('matchRequest')
->with($request)
->with($this->callback(function (Request $actual) use ($expected): bool {
$actual->server->remove('REQUEST_TIME_FLOAT');

return $actual == $expected;
}))
->will($this->throwException(new ResourceNotFoundException()))
;

Expand Down

0 comments on commit 30730cf

Please sign in to comment.