diff --git a/src/Routing/Route/RouteFactory.php b/src/Routing/Route/RouteFactory.php index d0beb03..1a167fc 100644 --- a/src/Routing/Route/RouteFactory.php +++ b/src/Routing/Route/RouteFactory.php @@ -7,7 +7,7 @@ use WellRESTed\Dispatching\DispatcherInterface; /** * @internal */ -class RouteFactory implements RouteFactoryInterface +class RouteFactory { private $dispatcher; @@ -27,7 +27,7 @@ class RouteFactory implements RouteFactoryInterface * @param string $target Route target or target pattern * @return Route */ - public function create($target) + public function create(string $target): Route { if ($target[0] === '/') { diff --git a/src/Routing/Route/RouteFactoryInterface.php b/src/Routing/Route/RouteFactoryInterface.php deleted file mode 100644 index 65bd41e..0000000 --- a/src/Routing/Route/RouteFactoryInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -dispatcher = $this->prophesize(DispatcherInterface::class); } - public function testCreatesStaticRoute() + public function testCreatesStaticRoute(): void { $factory = new RouteFactory($this->dispatcher->reveal()); $route = $factory->create('/cats/'); $this->assertSame(Route::TYPE_STATIC, $route->getType()); } - public function testCreatesPrefixRoute() + public function testCreatesPrefixRoute(): void { $factory = new RouteFactory($this->dispatcher->reveal()); $route = $factory->create('/cats/*'); $this->assertSame(Route::TYPE_PREFIX, $route->getType()); } - public function testCreatesRegexRoute() + public function testCreatesRegexRoute(): void { $factory = new RouteFactory($this->dispatcher->reveal()); $route = $factory->create('~/cat/[0-9]+~'); $this->assertSame(Route::TYPE_PATTERN, $route->getType()); } - public function testCreatesTemplateRoute() + public function testCreatesTemplateRoute(): void { $factory = new RouteFactory($this->dispatcher->reveal()); $route = $factory->create('/cat/{id}'); diff --git a/test/tests/unit/Routing/RouterTest.php b/test/tests/unit/Routing/RouterTest.php index 012e4c0..8548db6 100644 --- a/test/tests/unit/Routing/RouterTest.php +++ b/test/tests/unit/Routing/RouterTest.php @@ -10,7 +10,6 @@ use WellRESTed\Message\Response; use WellRESTed\Message\ServerRequest; use WellRESTed\Routing\Route\Route; use WellRESTed\Routing\Route\RouteFactory; -use WellRESTed\Routing\Route\RouteFactoryInterface; use WellRESTed\Test\Doubles\NextMock; use WellRESTed\Test\TestCase; @@ -449,7 +448,7 @@ class RouterWithFactory extends Router { public static $routeFactory; - protected function getRouteFactory(DispatcherInterface $dispatcher): RouteFactoryInterface + protected function getRouteFactory(DispatcherInterface $dispatcher): RouteFactory { return self::$routeFactory; }