Skip to content

Commit

Permalink
Merge branch 'master' into default-mime-type
Browse files Browse the repository at this point in the history
  • Loading branch information
harikt committed Oct 23, 2017
2 parents f0a5f98 + 74dd06f commit f7cca5b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"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",
"webimpress/http-middleware-compatibility": "^0.1.4"
},
"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": {
Expand Down
10 changes: 5 additions & 5 deletions src/AssetAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

Expand All @@ -83,6 +83,6 @@ public function process(ServerRequestInterface $request, DelegateInterface $dele
}
}

return $delegate($request);
return $handler->handle($request);
}
}
4 changes: 2 additions & 2 deletions tests/src/AssetActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
15 changes: 0 additions & 15 deletions tests/src/Delegate.php

This file was deleted.

15 changes: 15 additions & 0 deletions tests/src/RequestHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Hkt\Psr7Asset;

use Interop\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response;

class RequestHandler implements RequestHandlerInterface
{
public function handle(ServerRequestInterface $request)
{
return new Response(null, 404);
}
}

0 comments on commit f7cca5b

Please sign in to comment.