1 | <?php |
||
21 | class Host implements NonGroupInterface |
||
22 | { |
||
23 | /** |
||
24 | * PHP Domain Parser (if available). |
||
25 | * |
||
26 | * @var Parser |
||
27 | */ |
||
28 | private static $domainParser; |
||
29 | |||
30 | /** |
||
31 | * Directive value. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $value = ''; |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function __construct(string $raw) |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public static function getField(): string |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function getValue(): string |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function __toString(): string |
||
84 | |||
85 | /** |
||
86 | * Validates host (if PHP Domain Parser is available). |
||
87 | * |
||
88 | * @param string $host |
||
89 | * @param string $raw |
||
90 | */ |
||
91 | private function validateHost(string $host, string $raw) |
||
100 | |||
101 | /** |
||
102 | * Sets the domain parser. |
||
103 | * |
||
104 | * @param Parser $domainParser |
||
105 | */ |
||
106 | public static function setDomainParser(Parser $domainParser) |
||
110 | } |
||
111 |