| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait ResponseDecorator |
||
| 11 | { |
||
| 12 | use MessageDecorator { |
||
| 13 | getMessage as getResponse; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Exchanges the underlying response with another. |
||
| 18 | * |
||
| 19 | * @return self |
||
| 20 | */ |
||
| 21 | public function withResponse(ResponseInterface $response) |
||
| 22 | { |
||
| 23 | 1 | $new = clone $this; |
|
| 24 | $new->message = $response; |
||
| 25 | 1 | ||
| 26 | 1 | return $new; |
|
| 27 | } |
||
| 28 | 1 | ||
| 29 | /** |
||
| 30 | * {@inheritdoc} |
||
| 31 | */ |
||
| 32 | public function getStatusCode() |
||
| 33 | { |
||
| 34 | 1 | return $this->message->getStatusCode(); |
|
|
|
|||
| 35 | } |
||
| 36 | 1 | ||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | public function withStatus($code, $reasonPhrase = '') |
||
| 41 | { |
||
| 42 | 1 | $new = clone $this; |
|
| 43 | $new->message = $this->message->withStatus($code, $reasonPhrase); |
||
| 44 | 1 | ||
| 45 | 1 | return $new; |
|
| 46 | } |
||
| 47 | 1 | ||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function getReasonPhrase() |
||
| 54 | } |
||
| 55 | } |
||
| 56 |