src/Mvc/Router/Decorator/ExceptionDecorator.php 1 location
|
@@ 93-100 (lines=8) @@
|
| 90 |
|
* @param int $status |
| 91 |
|
* @return \Psr\Http\Message\MessageInterface|Response |
| 92 |
|
*/ |
| 93 |
|
protected function getResponseWithBodyAndStatus(ResponseInterface $response, string $body, int $status = 200) |
| 94 |
|
{ |
| 95 |
|
$stream = new Stream('php://memory', 'r+'); |
| 96 |
|
$stream->write($body); |
| 97 |
|
$response = $response->withStatus($status)->withBody($stream); |
| 98 |
|
|
| 99 |
|
return $response; |
| 100 |
|
} |
| 101 |
|
} |
src/Mvc/Router/PlatesStrategy.php 1 location
|
@@ 124-131 (lines=8) @@
|
| 121 |
|
* @param int $status |
| 122 |
|
* @return \Psr\Http\Message\MessageInterface|Response |
| 123 |
|
*/ |
| 124 |
|
private function getResponseWithBodyAndStatus(Response $response, string $body, int $status = 200) |
| 125 |
|
{ |
| 126 |
|
$stream = new Stream('php://memory', 'r+'); |
| 127 |
|
$stream->write($body); |
| 128 |
|
$response = $response->withStatus($status)->withBody($stream); |
| 129 |
|
|
| 130 |
|
return $response; |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
/** |
| 134 |
|
* Get a middleware that will decorate a NotFoundException |