Skip to content
This repository was archived by the owner on May 2, 2019. It is now read-only.

Commit 389e000

Browse files
committed
Removed HTTP context
1 parent 72e1667 commit 389e000

5 files changed

Lines changed: 3 additions & 100 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"php": "^7.0",
2121
"psr/http-message": "^1.0",
2222
"psr/http-server-middleware": "^1.0",
23-
"shoot/shoot": "^0.3"
23+
"shoot/shoot": "^0.4"
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "^6.5"

src/Context.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Middleware.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function __construct(PipelineInterface $pipeline)
3333
*/
3434
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
3535
{
36-
$context = new Context($request);
37-
38-
return $this->pipeline->withContext($context, function () use ($request, $handler): ResponseInterface {
36+
return $this->pipeline->withContext($request, function () use ($request, $handler): ResponseInterface {
3937
return $handler->handle($request);
4038
});
4139
}

tests/ContextTest.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

tests/MiddlewareTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Psr\Http\Message\ResponseInterface;
1010
use Psr\Http\Message\ServerRequestInterface;
1111
use Psr\Http\Server\RequestHandlerInterface;
12-
use Shoot\Http\Context;
1312
use Shoot\Http\Middleware;
1413
use Shoot\Shoot\PipelineInterface;
1514

@@ -49,7 +48,7 @@ public function testHttpContextShouldBeSetOnPipeline()
4948

5049
/** @var MethodProphecy $withContextMethod */
5150
$withContextMethod = $pipelineProphecy
52-
->withContext(Argument::type(Context::class), Argument::type('callable'))
51+
->withContext(Argument::type(ServerRequestInterface::class), Argument::type('callable'))
5352
->willReturn($this->response);
5453

5554
/** @var PipelineInterface $pipeline */

0 commit comments

Comments
 (0)