Skip to content

Commit

Permalink
4.0-dev is missing the RouterInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed May 17, 2021
1 parent f34c748 commit bc9fa51
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Aura Router implementation for [chubbyphp-framework][1].

* php: ^7.4|^8.0
* [aura/router][2]: ^3.1
* [chubbyphp/chubbyphp-framework][1]: ^3.2
* [chubbyphp/chubbyphp-framework][1]: ^3.5

## Installation

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require": {
"php": "^7.4|^8.0",
"aura/router": "^3.1",
"chubbyphp/chubbyphp-framework": "^3.2|^4.0@dev"
"chubbyphp/chubbyphp-framework": "^3.5|^4.0@dev"
},
"require-dev": {
"bittyphp/http": "^2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
use Chubbyphp\Framework\Router\Exceptions\MissingRouteByNameException;
use Chubbyphp\Framework\Router\Exceptions\NotFoundException;
use Chubbyphp\Framework\Router\RouteInterface;
use Chubbyphp\Framework\Router\RouterInterface;
use Chubbyphp\Framework\Router\RouteMatcherInterface;
use Chubbyphp\Framework\Router\UrlGeneratorInterface;
use Psr\Http\Message\ServerRequestInterface;

final class Router implements RouterInterface
final class Router implements RouteMatcherInterface, UrlGeneratorInterface
{
public const PATH_DEFAULTS = 'defaults';
public const PATH_HOST = 'host';
Expand Down
12 changes: 6 additions & 6 deletions tests/Integration/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Bitty\Http\ServerRequestFactory as BittyServerRequestFactory;
use Chubbyphp\Framework\Application;
use Chubbyphp\Framework\Middleware\ExceptionMiddleware;
use Chubbyphp\Framework\Middleware\RouterMiddleware;
use Chubbyphp\Framework\Middleware\RouteMatcherMiddleware;
use Chubbyphp\Framework\RequestHandler\CallbackRequestHandler;
use Chubbyphp\Framework\Router\Aura\Router;
use Chubbyphp\Framework\Router\Route;
Expand Down Expand Up @@ -84,7 +84,7 @@ static function (ServerRequestInterface $request) use ($responseFactory) {

$app = new Application([
new ExceptionMiddleware($responseFactory, true),
new RouterMiddleware(new Router([$route]), $responseFactory),
new RouteMatcherMiddleware(new Router([$route]), $responseFactory),
]);

$request = $serverRequestFactory->createServerRequest(
Expand Down Expand Up @@ -117,7 +117,7 @@ static function (ServerRequestInterface $request) use ($responseFactory) {

$app = new Application([
new ExceptionMiddleware($responseFactory, true),
new RouterMiddleware(new Router([$route]), $responseFactory),
new RouteMatcherMiddleware(new Router([$route]), $responseFactory),
]);

$request = $serverRequestFactory->createServerRequest(
Expand Down Expand Up @@ -153,7 +153,7 @@ static function (ServerRequestInterface $request) use ($responseFactory) {

$app = new Application([
new ExceptionMiddleware($responseFactory, true),
new RouterMiddleware(new Router([$route]), $responseFactory),
new RouteMatcherMiddleware(new Router([$route]), $responseFactory),
]);

$request = $serverRequestFactory->createServerRequest(
Expand Down Expand Up @@ -185,7 +185,7 @@ static function (): void {

$app = new Application([
new ExceptionMiddleware($responseFactory, true),
new RouterMiddleware(new Router([$route]), $responseFactory),
new RouteMatcherMiddleware(new Router([$route]), $responseFactory),
]);

$request = $serverRequestFactory->createServerRequest(
Expand Down Expand Up @@ -220,7 +220,7 @@ static function (): void {
), [], ['tokens' => ['name' => '[a-z]+']]);

$app = new Application([
new RouterMiddleware(new Router([$route]), $responseFactory),
new RouteMatcherMiddleware(new Router([$route]), $responseFactory),
]);

$request = $serverRequestFactory->createServerRequest(
Expand Down

0 comments on commit bc9fa51

Please sign in to comment.