1 | <?php declare (strict_types = 1); |
||
32 | class BundleStorage implements BundleStorageInterface |
||
33 | { |
||
34 | /** Encode index */ |
||
35 | const INDEX_DEFAULT_LOCALE = 0; |
||
36 | |||
37 | /** Encode index */ |
||
38 | const INDEX_DATA = self::INDEX_DEFAULT_LOCALE + 1; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $encodedStorage; |
||
44 | |||
45 | /** |
||
46 | * @var string[] |
||
47 | */ |
||
48 | private $locales; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | private $defaultLocale; |
||
54 | |||
55 | /** |
||
56 | * @param array $encodedStorage |
||
57 | */ |
||
58 | 7 | public function __construct(array $encodedStorage) |
|
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 7 | public function has(string $locale, string $namespace, string $key): bool |
|
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 7 | public function get(string $locale, string $namespace, string $key): ?array |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | 1 | public function hasResources(string $locale, string $namespace): bool |
|
101 | |||
102 | /** |
||
103 | * @inheritdoc |
||
104 | */ |
||
105 | 1 | public function getResources(string $locale, string $namespace): array |
|
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | 7 | public function getDefaultLocale(): string |
|
123 | |||
124 | /** |
||
125 | * @return array |
||
126 | */ |
||
127 | 7 | protected function getEncodedStorage(): array |
|
131 | |||
132 | /** |
||
133 | * @param string[] $locales |
||
134 | * @param string $locale |
||
135 | * @param string $defaultLocale |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | 7 | protected function lookupLocale(array $locales, string $locale, string $defaultLocale): string |
|
144 | |||
145 | /** |
||
146 | * @return string[] |
||
147 | */ |
||
148 | 7 | protected function getLocales(): array |
|
152 | |||
153 | /** |
||
154 | * @param array $encodedStorage |
||
155 | * |
||
156 | * @return self |
||
157 | */ |
||
158 | 7 | protected function setEncodedStorage(array $encodedStorage): self |
|
174 | |||
175 | /** |
||
176 | * @param array $encodedData |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | 7 | private function checkEncodedData(array $encodedData): bool |
|
191 | |||
192 | /** |
||
193 | * @param array $namespaceResources |
||
194 | * |
||
195 | * @return bool |
||
196 | */ |
||
197 | 7 | private function checkNamespaceResources(array $namespaceResources): bool |
|
208 | |||
209 | /** |
||
210 | * @param array $resources |
||
211 | * |
||
212 | * @return bool |
||
213 | */ |
||
214 | 7 | private function checkResources(array $resources): bool |
|
223 | |||
224 | /** |
||
225 | * @param string $key |
||
226 | * @param array $valueAndLocale |
||
227 | * |
||
228 | * @return bool |
||
229 | */ |
||
230 | 7 | private function checkPair(string $key, array $valueAndLocale): bool |
|
236 | |||
237 | /** |
||
238 | * @param array $valueAndLocale |
||
239 | * |
||
240 | * @return bool |
||
241 | */ |
||
242 | 7 | private function checkValueWithLocale(array $valueAndLocale): bool |
|
251 | } |
||
252 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..