1 | <?php |
||
10 | final class Response implements JsonSerializable |
||
11 | { |
||
12 | /** |
||
13 | * @var bool|null |
||
14 | */ |
||
15 | private $finished; |
||
16 | |||
17 | /** |
||
18 | * @var mixed[] |
||
19 | */ |
||
20 | private $headerList = []; |
||
21 | |||
22 | /** |
||
23 | * @var bool|null |
||
24 | */ |
||
25 | private $hasHeadersSent; |
||
26 | |||
27 | /** |
||
28 | * @var int|null |
||
29 | */ |
||
30 | private $httpStatusCode; |
||
31 | |||
32 | 4 | public static function fromHttpResponse(ResponseInterface $response): self |
|
36 | |||
37 | 1 | public function thatIsFinished(): self |
|
44 | |||
45 | 1 | public function thatIsNotFinished(): self |
|
52 | |||
53 | /** |
||
54 | * @param mixed $value |
||
55 | */ |
||
56 | 4 | public function withHeader(string $name, $value): self |
|
63 | |||
64 | 1 | public function thatHasSentHeaders(): self |
|
71 | |||
72 | 1 | public function thatHasNotSentHeaders(): self |
|
79 | |||
80 | 7 | public function resultingInStatusCode(int $httpStatusCode): self |
|
87 | |||
88 | /** |
||
89 | * @return mixed[] |
||
90 | */ |
||
91 | 9 | public function jsonSerialize(): array |
|
100 | } |
||
101 |