Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class JsonResponseFormatter implements ResponseFormatterInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var string the Content-Type header for the response |
||
15 | */ |
||
16 | private string $contentType = 'application/json'; |
||
17 | |||
18 | private int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; |
||
19 | |||
20 | public function format(WebResponse $webResponse): ResponseInterface |
||
28 | } |
||
29 | |||
30 | public function withOptions(int $options): self |
||
35 | } |
||
36 | |||
37 | public function withContentType(string $contentType): self |
||
44 |