Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TranslationUpdateCommand call undefined TranslationWriterInterface::getFormat() #43466

Closed
@noemi-salaun

Description

@noemi-salaun

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions