1 | <?php |
||
28 | final class FileStorage implements Storage, TransferableStorage |
||
29 | { |
||
30 | /** |
||
31 | * @var TranslationWriter |
||
32 | */ |
||
33 | private $writer; |
||
34 | |||
35 | /** |
||
36 | * @var TranslationLoader|SymfonyTranslationLoader |
||
37 | */ |
||
38 | private $loader; |
||
39 | |||
40 | /** |
||
41 | * @var array directory path |
||
42 | */ |
||
43 | private $dir; |
||
44 | |||
45 | /** |
||
46 | * @var array with option to the dumper |
||
47 | */ |
||
48 | private $options; |
||
49 | |||
50 | /** |
||
51 | * @var MessageCatalogue[] Fetched catalogies |
||
52 | */ |
||
53 | private $catalogues; |
||
54 | |||
55 | /** |
||
56 | * @param TranslationWriter $writer |
||
57 | * @param SymfonyTranslationLoader|TranslationLoader|TranslationReader $loader |
||
58 | * @param array $dir |
||
59 | * @param array $options |
||
60 | */ |
||
61 | 10 | public function __construct(TranslationWriter $writer, $loader, array $dir, array $options = []) |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 1 | public function get($locale, $domain, $key) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 2 | public function create(Message $m) |
|
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | 1 | public function update(Message $m) |
|
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | 1 | public function delete($locale, $domain, $key) |
|
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | 1 | public function export(MessageCatalogueInterface $catalogue) |
|
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | 1 | public function import(MessageCatalogueInterface $catalogue) |
|
151 | |||
152 | /** |
||
153 | * Save catalogue back to file. |
||
154 | * |
||
155 | * @param MessageCatalogue $catalogue |
||
156 | * @param string $domain |
||
157 | */ |
||
158 | 5 | private function writeCatalogue(MessageCatalogue $catalogue, $locale, $domain) |
|
181 | |||
182 | /** |
||
183 | * @param string $locale |
||
184 | * |
||
185 | * @return MessageCatalogue |
||
186 | */ |
||
187 | 6 | private function getCatalogue($locale) |
|
195 | |||
196 | /** |
||
197 | * Load catalogue from files. |
||
198 | * |
||
199 | * @param string $locale |
||
200 | * @param array $dirs |
||
201 | */ |
||
202 | 6 | private function loadCatalogue($locale, array $dirs) |
|
213 | |||
214 | /** |
||
215 | * This method calls the new TranslationWriter::write() if exist, |
||
216 | * otherwise fallback to TranslationWriter::writeTranslations() call |
||
217 | * to avoid BC breaks. |
||
218 | * |
||
219 | * @param MessageCatalogue $catalogue |
||
220 | * @param string $format |
||
221 | * @param array $options |
||
222 | */ |
||
223 | 5 | private function writeTranslations(MessageCatalogue $catalogue, $format, array $options) |
|
232 | } |
||
233 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.