1 | <?php |
||
11 | class HostClient implements ClientInterface |
||
12 | { |
||
13 | use UrlParser; |
||
14 | |||
15 | /** |
||
16 | * Base Uri |
||
17 | * @var string |
||
18 | */ |
||
19 | private $base; |
||
20 | |||
21 | /** |
||
22 | * Host |
||
23 | * @var string[] |
||
24 | */ |
||
25 | private $host; |
||
26 | |||
27 | /** |
||
28 | * Parent directive |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $parent; |
||
32 | |||
33 | /** |
||
34 | * HostClient constructor. |
||
35 | * |
||
36 | * @param string $base |
||
37 | * @param string[] $host |
||
38 | * @param string|null $parentDirective |
||
39 | */ |
||
40 | public function __construct($base, array $host, $parentDirective = null) |
||
46 | |||
47 | /** |
||
48 | * Preferred host |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function isPreferred() |
||
65 | |||
66 | /** |
||
67 | * Get |
||
68 | * |
||
69 | * @return string|null |
||
70 | */ |
||
71 | public function get() |
||
75 | |||
76 | /** |
||
77 | * Preferred host |
||
78 | * |
||
79 | * @param string $url |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function isListed($url) |
||
103 | |||
104 | /** |
||
105 | * Export |
||
106 | * |
||
107 | * @return string[]|string|null |
||
108 | */ |
||
109 | public function export() |
||
116 | } |
||
117 |