1 | <?php |
||
27 | final class FileStorage implements Storage, TransferableStorage |
||
28 | { |
||
29 | /** |
||
30 | * @var TranslationWriter |
||
31 | */ |
||
32 | private $writer; |
||
33 | |||
34 | /** |
||
35 | * @var TranslationLoader|SymfonyTranslationLoader |
||
36 | */ |
||
37 | private $loader; |
||
38 | |||
39 | /** |
||
40 | * @var array directory path |
||
41 | */ |
||
42 | private $dir; |
||
43 | |||
44 | /** |
||
45 | * @var array with option to the dumper |
||
46 | */ |
||
47 | private $options; |
||
48 | |||
49 | /** |
||
50 | * @var MessageCatalogue[] Fetched catalogies |
||
51 | */ |
||
52 | private $catalogues; |
||
53 | |||
54 | /** |
||
55 | * @param TranslationWriter $writer |
||
56 | * @param SymfonyTranslationLoader|TranslationLoader $loader |
||
57 | * @param array $dir |
||
58 | * @param array $options |
||
59 | */ |
||
60 | 10 | public function __construct(TranslationWriter $writer, $loader, array $dir, array $options = []) |
|
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 1 | public function get($locale, $domain, $key) |
|
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | 2 | public function create(Message $m) |
|
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | 1 | public function update(Message $m) |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 1 | public function delete($locale, $domain, $key) |
|
126 | |||
127 | /** |
||
128 | * {@inheritdoc} |
||
129 | */ |
||
130 | 1 | public function export(MessageCatalogueInterface $catalogue) |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 1 | public function import(MessageCatalogueInterface $catalogue) |
|
146 | |||
147 | /** |
||
148 | * Save catalogue back to file. |
||
149 | * |
||
150 | * @param MessageCatalogue $catalogue |
||
151 | * @param string $domain |
||
152 | */ |
||
153 | 5 | private function writeCatalogue(MessageCatalogue $catalogue, $locale, $domain) |
|
176 | |||
177 | /** |
||
178 | * @param string $locale |
||
179 | * |
||
180 | * @return MessageCatalogue |
||
181 | */ |
||
182 | 6 | private function getCatalogue($locale) |
|
190 | |||
191 | /** |
||
192 | * Load catalogue from files. |
||
193 | * |
||
194 | * @param string $locale |
||
195 | * @param array $dirs |
||
196 | */ |
||
197 | 6 | private function loadCatalogue($locale, array $dirs) |
|
208 | } |
||
209 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.