Symfony version(s) affected: 5.3, 4.4, 3.4
Description
TranslationWriterInterface does not define a getFormat() method but TranslationUpdateCommand call $writer->getFormat() even when it only depends on TranslationWriterInterface and not the TranslationWriter implementation that actually define getFormat().
How to reproduce
- Replace the
$writer service injected in TranslationUpdateCommand with a custom writer that implements TranslationWriterInterface without having a getFormat() method (which is not part of the interface)
- Call the command and see the error
Attempted to call an undefined method named "getFormats" of class "App\MyCustomTranslationWriter"
Possible Solution
Add the getFormat() method to the TranslationWriterInterface