1 | <?php |
||
17 | class HostClient implements ClientInterface |
||
18 | { |
||
19 | /** |
||
20 | * Host values |
||
21 | * @var string[] |
||
22 | */ |
||
23 | protected $host; |
||
24 | |||
25 | /** |
||
26 | * Base uri |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $base; |
||
30 | |||
31 | /** |
||
32 | * Effective uri |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $effective; |
||
36 | |||
37 | /** |
||
38 | * HostClient constructor. |
||
39 | * @param string $base |
||
40 | * @param string $effective |
||
41 | * @param string[] $host |
||
42 | */ |
||
43 | public function __construct($base, $effective, $host) |
||
49 | |||
50 | /** |
||
51 | * Is preferred host? |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function isPreferred() |
||
68 | |||
69 | /** |
||
70 | * Export |
||
71 | * |
||
72 | * @return string|null |
||
73 | */ |
||
74 | public function export() |
||
78 | |||
79 | /** |
||
80 | * Get Host, falls back to Effective Request URI if not found |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getWithUriFallback() |
||
98 | } |
||
99 |