1 | <?php |
||
15 | class Formatter implements FormatterInterface |
||
16 | { |
||
17 | use PropertyFilterTrait; |
||
18 | |||
19 | const KEY_LOWER = 1; |
||
20 | const KEY_UPPER = 2; |
||
21 | |||
22 | const VALUE_TYPED = 4; |
||
23 | const VALUE_UNKNOWN_TO_NULL = 8; |
||
24 | const VALUE_BOOLEAN_TO_STRING = 16; |
||
25 | const VALUE_REG_EXP_LOWER = 32; |
||
26 | |||
27 | const RETURN_OBJECT = 64; |
||
28 | const RETURN_ARRAY = 128; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $options; |
||
34 | |||
35 | /** |
||
36 | * Formatter constructor. |
||
37 | * |
||
38 | * @param int $options |
||
39 | */ |
||
40 | public function __construct(int $options = 0) |
||
44 | |||
45 | /** |
||
46 | * @return int |
||
47 | */ |
||
48 | protected function getOptions() : int |
||
52 | |||
53 | /** |
||
54 | * @param int $options |
||
55 | */ |
||
56 | protected function setOptions(int $options) |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | * |
||
64 | * @return array|\stdClass |
||
65 | */ |
||
66 | public function format(array $browscapData) |
||
85 | |||
86 | /** |
||
87 | * @param string $key |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | protected function modifyKey(string $key) |
||
102 | |||
103 | /** |
||
104 | * @param string $key |
||
105 | * @param string $value |
||
106 | * |
||
107 | * @return mixed |
||
108 | */ |
||
109 | protected function modifyValue(string $key, string $value) |
||
140 | |||
141 | /** |
||
142 | * @param string $key |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | protected function hasBooleanValue(string $key) : bool |
||
172 | |||
173 | /** |
||
174 | * @param string $key |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | protected function hasIntegerValue(string $key) : bool |
||
192 | |||
193 | /** |
||
194 | * @param string $key |
||
195 | * |
||
196 | * @return bool |
||
197 | */ |
||
198 | protected function hasFloatValue(string $key) : bool |
||
205 | } |
||
206 |