1 | <?php |
||
13 | class HttpFetcher extends AbstractFetcher |
||
14 | { |
||
15 | const STATUS_CODE_HIGHER_THAN_ALLOWED_EXCEPTION_MESSAGE = 'Returned response code >>%d<< is above the limit of >>%d<<. Dumping the response >>%s<<.'; |
||
16 | |||
17 | /** @var int */ |
||
18 | private $highestAllowedStatusCode; |
||
19 | |||
20 | /** @var Builder */ |
||
21 | private $requestBuilder; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $url; |
||
25 | |||
26 | |||
27 | |||
28 | /** |
||
29 | * HttpFetcher constructor. |
||
30 | * |
||
31 | * @param Builder $builder |
||
32 | * @param int $highestAllowedStatusCode |
||
33 | */ |
||
34 | public function __construct( |
||
41 | |||
42 | /** |
||
43 | * @param string $url |
||
44 | */ |
||
45 | public function setUrl($url) |
||
49 | |||
50 | |||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | * @throws RuntimeException |
||
55 | * @throws Exception |
||
56 | */ |
||
57 | protected function fetchContentAsStringOrThrowRuntimeException() |
||
88 | } |
||
89 |