Conditions | 2 |
Paths | 1 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
70 | 3 | public function send(IRequest $httpRequest, IResponse $httpResponse): void |
|
71 | { |
||
72 | 3 | $httpResponse->setContentType($this->getContentType(), $this->getCharset()); |
|
73 | 3 | $httpResponse->setExpiration($this->getExpiration() ? $this->getExpiration()->format('c') : null); |
|
74 | 3 | $result = Json::encode($this->getPayload()); |
|
75 | 3 | $httpResponse->setHeader('Content-Length', (string) strlen($result)); |
|
76 | 3 | echo $result; |
|
77 | 3 | } |
|
78 | } |
||
79 |