3131use FormatPHP \Exception \UnableToWriteFileException ;
3232use FormatPHP \Extractor \Parser \Descriptor \PhpParser ;
3333use FormatPHP \Extractor \Parser \DescriptorParserInterface ;
34+ use FormatPHP \Format \Writer \FormatPHPWriter ;
35+ use FormatPHP \Format \Writer \SimpleWriter ;
36+ use FormatPHP \Format \Writer \SmartlingWriter ;
37+ use FormatPHP \Format \WriterInterface ;
3438use FormatPHP \Util \FileSystemHelper ;
3539use FormatPHP \Util \Globber ;
36- use FormatPHP \Writer \Format \FormatPHP ;
37- use FormatPHP \Writer \Format \Simple ;
38- use FormatPHP \Writer \Format \Smartling ;
39- use FormatPHP \Writer \FormatInterface ;
4040use LogicException ;
4141use Psr \Log \LoggerInterface ;
4242
@@ -183,20 +183,20 @@ private function getPhpParser(): PhpParser
183183 private function getFormatter (?string $ format ): callable
184184 {
185185 if ($ format === null ) {
186- return new FormatPHP ();
186+ return new FormatPHPWriter ();
187187 }
188188
189189 switch (strtolower ($ format )) {
190190 case 'simple ' :
191- return new Simple ();
191+ return new SimpleWriter ();
192192 case 'smartling ' :
193- return new Smartling ();
193+ return new SmartlingWriter ();
194194 case 'formatjs ' :
195195 case 'formatphp ' :
196- return new FormatPHP ();
196+ return new FormatPHPWriter ();
197197 }
198198
199- if (class_exists ($ format ) && is_a ($ format , FormatInterface ::class, true )) {
199+ if (class_exists ($ format ) && is_a ($ format , WriterInterface ::class, true )) {
200200 $ formatter = new $ format ();
201201 } else {
202202 /** @var Closure(DescriptorCollection,MessageExtractorOptions):array<mixed> | null $formatter */
@@ -210,7 +210,7 @@ private function getFormatter(?string $format): callable
210210 throw new InvalidArgumentException (sprintf (
211211 'The format provided is not a known format, an instance of '
212212 . '%s, or a callable of the shape `callable(%s,%s):array<mixed>`. ' ,
213- FormatInterface ::class,
213+ WriterInterface ::class,
214214 DescriptorCollection::class,
215215 MessageExtractorOptions::class,
216216 ));
0 commit comments