From 5180e053d4cbb46a09d8a2b666303c71cabf4df6 Mon Sep 17 00:00:00 2001 From: oscarotero Date: Sat, 11 Nov 2017 19:25:43 +0100 Subject: [PATCH] Switch to http-server-middleware --- .travis.yml | 1 - CHANGELOG.md | 10 ++++++++++ README.md | 2 +- composer.json | 8 ++++---- src/FastRoute.php | 18 ++++-------------- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d2478b..d180b65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: php sudo: false php: - - 5.6 - 7.0 - 7.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f405c8..6fa4b67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## UNRELEASED + +### Removed + +* Removed support for PHP 5.x. + +### Changed + +* Replaced `http-interop/http-middleware` with `http-interop/http-server-middleware`. + ## [0.8.0] - 2017-09-21 ### Changed diff --git a/README.md b/README.md index 67e03f7..527e9dd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Middleware to use [FastRoute](https://github.com/nikic/FastRoute) for handler di ## Requirements -* PHP >= 5.6 +* PHP >= 7.0 * A [PSR-7](https://packagist.org/providers/psr/http-message-implementation) http mesage implementation ([Diactoros](https://github.com/zendframework/zend-diactoros), [Guzzle](https://github.com/guzzle/psr7), [Slim](https://github.com/slimphp/Slim), etc...) * A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher) diff --git a/composer.json b/composer.json index 93568fa..ce0ac1b 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ "issues": "https://github.com/middlewares/fast-route/issues" }, "require": { - "php": "^5.6 || ^7.0", - "http-interop/http-middleware": "^0.5", + "php": "^7.0", "nikic/fast-route": "^1.0", - "middlewares/utils": "~0.12" + "middlewares/utils": "~0.13", + "http-interop/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^5.5 || ^6.0", + "phpunit/phpunit": "^6.0", "zendframework/zend-diactoros": "^1.3", "friendsofphp/php-cs-fixer": "^2.0", "squizlabs/php_codesniffer": "^3.0", diff --git a/src/FastRoute.php b/src/FastRoute.php index 73a2c6e..8e7ff60 100644 --- a/src/FastRoute.php +++ b/src/FastRoute.php @@ -1,4 +1,5 @@ attribute = $attribute; @@ -47,13 +42,8 @@ public function attribute($attribute) /** * Process a server request and return a response. - * - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * - * @return ResponseInterface */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $route = $this->router->dispatch($request->getMethod(), $request->getUri()->getPath()); @@ -82,7 +72,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface * * @return ServerRequestInterface */ - protected function setHandler(ServerRequestInterface $request, $handler) + protected function setHandler(ServerRequestInterface $request, $handler): ServerRequestInterface { return $request->withAttribute($this->attribute, $handler); }