From 55dbb27ff1c9b965bd16d1c8075d5aa63e7ae6d6 Mon Sep 17 00:00:00 2001 From: Mika Tuupola Date: Mon, 27 Nov 2017 18:46:08 +0700 Subject: [PATCH 1/5] Update to http-interop/http-middleware ^1.0 --- composer.json | 2 +- src/Handler.php | 2 +- src/MiddlewareCollection.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e8610bc..f64a8c2 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">=5.6", - "http-interop/http-middleware": "^0.5" + "http-interop/http-server-middleware": "^1.0" }, "require-dev": { "phpunit/phpunit": "^4.8|^5.0", diff --git a/src/Handler.php b/src/Handler.php index 7c38758..d5f5617 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -40,7 +40,7 @@ public function __construct(array $middleware, callable $default) * * @return ResponseInterface */ - public function handle(ServerRequestInterface $request) + public function handle(ServerRequestInterface $request): ResponseInterface { if (empty($this->middleware[$this->index])) { return call_user_func($this->default, $request); diff --git a/src/MiddlewareCollection.php b/src/MiddlewareCollection.php index 2bb0ea0..5357133 100644 --- a/src/MiddlewareCollection.php +++ b/src/MiddlewareCollection.php @@ -76,7 +76,7 @@ public function dispatch(ServerRequestInterface $request, callable $default) /** * @inheritdoc */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $nextContainerHandler) + public function process(ServerRequestInterface $request, RequestHandlerInterface $nextContainerHandler): ResponseInterface { $default = new HandlerProxy($nextContainerHandler); $handler = new Handler($this->middleware, $default); From 1854314a03e28526dfc62938c192fb4f39fe24c3 Mon Sep 17 00:00:00 2001 From: Mika Tuupola Date: Mon, 27 Nov 2017 18:53:36 +0700 Subject: [PATCH 2/5] PSR-15 does not support PHP 5.6 nor HHVM --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47a7dce..d22ce8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,17 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 - nightly - - hhvm matrix: fast_finish: true allow_failures: - php: nightly include: - - php: 5.6 + - php: 7.0 env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' before_script: From f7e0dbb235bee367a0fac72ec1ce0620276a12dd Mon Sep 17 00:00:00 2001 From: Mika Tuupola Date: Tue, 28 Nov 2017 10:35:52 +0700 Subject: [PATCH 3/5] Correct version numbers for PHP 7.x --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f64a8c2..f87ae46 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ } ], "require": { - "php": ">=5.6", + "php": ">=7.0", "http-interop/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.0", + "phpunit/phpunit": "^5.7|^6.0", "eloquent/phony": "^0.14.3", "eloquent/liberator": "^2.0" }, From bcb3e430da4b8d94dd1a56da510088a1cbf8d108 Mon Sep 17 00:00:00 2001 From: Mika Tuupola Date: Tue, 28 Nov 2017 12:50:37 +0700 Subject: [PATCH 4/5] Use phpunit/phpunit ^5.7 only Supporting PHPUnit 6.x requires more fiddling than just changing all instances of PHPUnit_Framework_TestCase to TestCase and probably needs a separate PR. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f87ae46..e9d299a 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "http-interop/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^5.7|^6.0", + "phpunit/phpunit": "^5.7", "eloquent/phony": "^0.14.3", "eloquent/liberator": "^2.0" }, From 2a5d467b011db2e78ad44f6ec1515f8c7e1dc4c9 Mon Sep 17 00:00:00 2001 From: Mika Tuupola Date: Wed, 29 Nov 2017 11:20:47 +0700 Subject: [PATCH 5/5] Remove unneeded docblocks --- src/Handler.php | 7 ------- src/MiddlewareCollection.php | 3 --- 2 files changed, 10 deletions(-) diff --git a/src/Handler.php b/src/Handler.php index d5f5617..7d69185 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -33,13 +33,6 @@ public function __construct(array $middleware, callable $default) $this->default = $default; } - /** - * Process the request using the current middleware. - * - * @param ServerRequestInterface $request - * - * @return ResponseInterface - */ public function handle(ServerRequestInterface $request): ResponseInterface { if (empty($this->middleware[$this->index])) { diff --git a/src/MiddlewareCollection.php b/src/MiddlewareCollection.php index 5357133..4a2245c 100644 --- a/src/MiddlewareCollection.php +++ b/src/MiddlewareCollection.php @@ -73,9 +73,6 @@ public function dispatch(ServerRequestInterface $request, callable $default) return $handler->handle($request); } - /** - * @inheritdoc - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $nextContainerHandler): ResponseInterface { $default = new HandlerProxy($nextContainerHandler);