1 | <?php |
||
8 | class ErrorResult implements Result |
||
9 | { |
||
10 | /** |
||
11 | * @var Url |
||
12 | */ |
||
13 | private $url; |
||
14 | |||
15 | /** |
||
16 | * @var HeaderCollection |
||
17 | */ |
||
18 | private $headers; |
||
19 | |||
20 | /** |
||
21 | * @var ErrorMessage |
||
22 | */ |
||
23 | private $errorMessage; |
||
24 | |||
25 | /** |
||
26 | * @param Url $url |
||
27 | * @param HeaderCollection $headers |
||
28 | * @param ErrorMessage $errorMessage |
||
29 | */ |
||
30 | public function __construct(Url $url, HeaderCollection $headers, ErrorMessage $errorMessage) |
||
36 | |||
37 | /** |
||
38 | * @param string $url |
||
39 | * @param array $headerData |
||
40 | * @param $errorMessage |
||
41 | * |
||
42 | * @return ErrorResult |
||
43 | */ |
||
44 | public static function fromPrimitives( |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function asString() |
||
63 | |||
64 | /** |
||
65 | * @return HeaderCollection |
||
66 | */ |
||
67 | public function getHeaders() |
||
71 | |||
72 | /** |
||
73 | * @return Url |
||
74 | */ |
||
75 | public function getUrl() |
||
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function isValidResult() |
||
87 | |||
88 | public function getTimeToFirstByte() |
||
92 | |||
93 | public function getBody() |
||
97 | |||
98 | public function getStatusCode() |
||
102 | } |
||
103 |