Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support latest PSR-15 #12

Merged
merged 5 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
}
],
"require": {
"php": ">=5.6",
"http-interop/http-middleware": "^0.5"
"php": ">=7.0",
"http-interop/http-server-middleware": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
"phpunit/phpunit": "^5.7",
"eloquent/phony": "^0.14.3",
"eloquent/liberator": "^2.0"
},
Expand Down
9 changes: 1 addition & 8 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ 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)
public function handle(ServerRequestInterface $request): ResponseInterface
{
if (empty($this->middleware[$this->index])) {
return call_user_func($this->default, $request);
Expand Down
5 changes: 1 addition & 4 deletions src/MiddlewareCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ public function dispatch(ServerRequestInterface $request, callable $default)
return $handler->handle($request);
}

/**
* @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);
Expand Down