1 | <?php |
||
10 | final class CurlWebLoader implements LoaderInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $prefix; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $curlOptions; |
||
21 | |||
22 | /** |
||
23 | * @var DecoderInterface |
||
24 | */ |
||
25 | private $jsonDecoder; |
||
26 | |||
27 | /** |
||
28 | * @param string $prefix |
||
29 | * @param array $curlOptions |
||
30 | * @param DecoderInterface $jsonDecoder |
||
31 | */ |
||
32 | 66 | public function __construct($prefix, array $curlOptions = null, DecoderInterface $jsonDecoder = null) |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 14 | public function load($path) |
|
56 | |||
57 | /** |
||
58 | * @param resource $ch |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | 14 | private function getResponseBodyAndStatusCode($ch) |
|
69 | |||
70 | /** |
||
71 | * @return array |
||
72 | */ |
||
73 | 66 | private function getDefaultCurlOptions() |
|
81 | |||
82 | /** |
||
83 | * @param array|null $curlOptions |
||
84 | */ |
||
85 | 66 | private function setCurlOptions($curlOptions) |
|
94 | } |
||
95 |