You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I lately updated a legacy Command to the new auto wire feature which needs the Translation Services.
After Updating the Command with: public function __construct( TranslationWriterInterface $writer, TranslationReaderInterface $reader, ExtractorInterface $extractor ) { ...
I got the error: argument "$writer" of method "__construct()" references interface "Symfony\Component\Translation\Writer\TranslationWriterInterf
ace" but no such service exists. It cannot be auto-registered because it is from a different root namespace.
Maybe i did not read the documentation carefully or just wasnt aware of how the identification of the services is done, so only with the help of the support channel i got the hint that there are default alias for other services, but not here.
If there is no side-effect, its maybe better to just create the aliases in the core then having them defined in the own service.yml:
I lately updated a legacy Command to the new auto wire feature which needs the Translation Services.
After Updating the Command with:
public function __construct( TranslationWriterInterface $writer, TranslationReaderInterface $reader, ExtractorInterface $extractor ) { ...
I got the error: argument "$writer" of method "__construct()" references interface "Symfony\Component\Translation\Writer\TranslationWriterInterf
ace" but no such service exists. It cannot be auto-registered because it is from a different root namespace.
Maybe i did not read the documentation carefully or just wasnt aware of how the identification of the services is done, so only with the help of the support channel i got the hint that there are default alias for other services, but not here.
If there is no side-effect, its maybe better to just create the aliases in the core then having them defined in the own service.yml:
Symfony\Component\Translation\Extractor\ExtractorInterface: '@translation.extractor' Symfony\Component\Translation\Writer\TranslationWriterInterface: '@translation.writer' Symfony\Component\Translation\Reader\TranslationReaderInterface: '@translation.reader'
The text was updated successfully, but these errors were encountered: