1 | <?php |
||
10 | class HostClient implements ClientInterface |
||
11 | { |
||
12 | /** |
||
13 | * Base uri |
||
14 | * @var string |
||
15 | */ |
||
16 | private $base; |
||
17 | |||
18 | /** |
||
19 | * Effective uri |
||
20 | * @var string |
||
21 | */ |
||
22 | private $effective; |
||
23 | |||
24 | /** |
||
25 | * Host values |
||
26 | * @var string[] |
||
27 | */ |
||
28 | private $host; |
||
29 | |||
30 | /** |
||
31 | * Parent directive |
||
32 | * @var string|null |
||
33 | */ |
||
34 | private $parent; |
||
35 | |||
36 | /** |
||
37 | * HostClient constructor. |
||
38 | * |
||
39 | * @param string $base |
||
40 | * @param string $effective |
||
41 | * @param string[] $host |
||
42 | * @param string|null $parentDirective |
||
43 | */ |
||
44 | public function __construct($base, $effective, array $host, $parentDirective = null) |
||
51 | |||
52 | /** |
||
53 | * Is preferred host |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function isPreferred() |
||
70 | |||
71 | /** |
||
72 | * Get Host |
||
73 | * |
||
74 | * @return string|null |
||
75 | */ |
||
76 | public function get() |
||
80 | |||
81 | /** |
||
82 | * Get Host, falls back to Effective Request URI if not found |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getWithUriFallback() |
||
101 | |||
102 | /** |
||
103 | * Export |
||
104 | * |
||
105 | * @return string[]|string|null |
||
106 | */ |
||
107 | public function export() |
||
114 | } |
||
115 |