From fc5fa8b0b4baa87756a0c6ee05eabbd45b65a809 Mon Sep 17 00:00:00 2001 From: Bas Kamer Date: Mon, 23 Oct 2017 16:45:53 +0200 Subject: [PATCH 1/4] update prerelease dependencies see #23 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e72a9f6..ca381da 100644 --- a/composer.json +++ b/composer.json @@ -15,12 +15,12 @@ "require": { "php":"^5.6 || ^7.0", "psr/http-message":"^1.0", - "http-interop/http-factory":"^0.2", - "http-interop/http-middleware": "^0.4.1" + "http-interop/http-factory":"^0.3", + "http-interop/http-middleware": "^0.5" }, "require-dev": { "phpunit/phpunit": "5.7", - "http-interop/http-factory-diactoros":"^0.2", + "http-interop/http-factory-diactoros":"^0.3", "aura/di": "^3.0" }, "suggest": { From 6be05f5436be3d41ec0c4e4b46299803dfcc3e91 Mon Sep 17 00:00:00 2001 From: Bas Kamer Date: Mon, 23 Oct 2017 17:19:17 +0200 Subject: [PATCH 2/4] adds webimpress/http-middleware-compatibility --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ca381da..62d263f 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "php":"^5.6 || ^7.0", "psr/http-message":"^1.0", "http-interop/http-factory":"^0.3", - "http-interop/http-middleware": "^0.5" + "http-interop/http-middleware": "^0.5", + "webimpress/http-middleware-compatibility": "^0.1.4" }, "require-dev": { "phpunit/phpunit": "5.7", From 1135c0dc1ecd26b1f924f68e5742276c952d07c7 Mon Sep 17 00:00:00 2001 From: Bas Kamer Date: Mon, 23 Oct 2017 17:19:28 +0200 Subject: [PATCH 3/4] apply --- src/AssetAction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/AssetAction.php b/src/AssetAction.php index b1d8dd2..2f8580e 100644 --- a/src/AssetAction.php +++ b/src/AssetAction.php @@ -2,8 +2,8 @@ namespace Hkt\Psr7Asset; use Psr\Http\Message\ServerRequestInterface; -use Interop\Http\ServerMiddleware\MiddlewareInterface; -use Interop\Http\ServerMiddleware\DelegateInterface; +use Interop\Http\Server\MiddlewareInterface; +use Interop\Http\Server\RequestHandlerInterface; /** * @@ -64,12 +64,12 @@ public function __construct( * * @param ServerRequestInterface $request * - * @param DelegateInterface $delegate + * @param RequestHandlerInterface $delegate * * @return ResponseInterface * */ - public function process(ServerRequestInterface $request, DelegateInterface $delegate) + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) { $route = $this->router->match($request); @@ -83,6 +83,6 @@ public function process(ServerRequestInterface $request, DelegateInterface $dele } } - return $delegate($request); + return $handler->handle($request); } } From 5b22abf7354c9c21cc89bfb39b2152d6b26cc2bb Mon Sep 17 00:00:00 2001 From: Bas Kamer Date: Mon, 23 Oct 2017 17:19:36 +0200 Subject: [PATCH 4/4] fix test --- tests/src/AssetActionTest.php | 4 ++-- tests/src/Delegate.php | 15 --------------- tests/src/RequestHandler.php | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 tests/src/Delegate.php create mode 100644 tests/src/RequestHandler.php diff --git a/tests/src/AssetActionTest.php b/tests/src/AssetActionTest.php index be86570..9e8a0e3 100644 --- a/tests/src/AssetActionTest.php +++ b/tests/src/AssetActionTest.php @@ -45,8 +45,8 @@ public function testProcess() [], [] ); - $delegate = new Delegate(); - $actual = $this->action->process($request, $delegate); + $requestHandler = new RequestHandler(); + $actual = $this->action->process($request, $requestHandler); $this->assertInstanceOf(ResponseInterface::class, $actual); diff --git a/tests/src/Delegate.php b/tests/src/Delegate.php deleted file mode 100644 index 0f17977..0000000 --- a/tests/src/Delegate.php +++ /dev/null @@ -1,15 +0,0 @@ -setStatusCode(404); - } -} diff --git a/tests/src/RequestHandler.php b/tests/src/RequestHandler.php new file mode 100644 index 0000000..f658588 --- /dev/null +++ b/tests/src/RequestHandler.php @@ -0,0 +1,15 @@ +