1 | <?php |
||
24 | class Alfred |
||
25 | { |
||
26 | /** |
||
27 | * Provides a list with available proxies for http requests |
||
28 | * |
||
29 | * @var LocatorInterface |
||
30 | */ |
||
31 | private $proxyLocator; |
||
32 | |||
33 | /** |
||
34 | * Alfred constructor. |
||
35 | * |
||
36 | * @param LocatorInterface $proxyLocator Uses a simple array node from configuration file to provide proxy list |
||
37 | */ |
||
38 | public function __construct(LocatorInterface $proxyLocator) |
||
42 | |||
43 | /** |
||
44 | * Returns proxy for http requests |
||
45 | * |
||
46 | * @return string |
||
47 | * |
||
48 | * @throws ProxyNotFoundException |
||
49 | */ |
||
50 | public function getProxy(): string |
||
63 | |||
64 | /** |
||
65 | * Returns numeric array with all available proxies |
||
66 | * |
||
67 | * @return string[] |
||
68 | */ |
||
69 | private function resolveProxyList(): array |
||
80 | } |
||
81 |