Skip to content

Commit

Permalink
Switch to http-server-middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 11, 2017
1 parent dcd07b1 commit fde9a56
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: php
sudo: false

php:
- 5.6
- 7.0
- 7.1

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.5.0] - 2017-09-21

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The UUID generated is compatible with [RFC 4122](http://tools.ietf.org/html/rfc4

## 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)

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"issues": "https://github.com/middlewares/uuid/issues"
},
"require": {
"php": "^5.6 || ^7.0",
"http-interop/http-middleware": "^0.5",
"ramsey/uuid": "^3.5"
"php": "^7.0",
"ramsey/uuid": "^3.5",
"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",
"middlewares/utils": "~0.12"
"middlewares/utils": "~0.13"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 3 additions & 11 deletions src/Uuid.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types = 1);

namespace Middlewares;

Expand All @@ -14,12 +15,8 @@ class Uuid implements MiddlewareInterface

/**
* Configure the header name to store the identifier
*
* @param string $header
*
* @return self
*/
public function header($header)
public function header(string $header): self
{
$this->header = $header;

Expand All @@ -28,13 +25,8 @@ public function header($header)

/**
* Process a 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
{
$uuid = (string) UuidFactory::uuid4();

Expand Down

0 comments on commit fde9a56

Please sign in to comment.