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

Skip to content

LoggingTranslator should implement Symfony\Contracts\Translation\TranslatorInterface #29089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
desmax opened this issue Nov 5, 2018 · 1 comment

Comments

@desmax
Copy link
Contributor

desmax commented Nov 5, 2018

Symfony version(s) affected: 4.2 beta 1

Description
I switched my code to use new Symfony\Contracts\Translation\TranslatorInterface, but I get this error Argument .. passed to ::__construct() must implement interface Symfony\Contracts\Translation\TranslatorInterface, instance of Symfony\Component\Translation\LoggingTranslator given

How to reproduce
try to autowire translator

Possible Solution
LoggingTranslator should implement Symfony\Contracts\Translation\TranslatorInterface

@desmax
Copy link
Contributor Author

desmax commented Nov 5, 2018

#29090

nicolas-grekas added a commit that referenced this issue Nov 6, 2018
…lation\TranslatorInterface (desmax)

This PR was merged into the 4.2-dev branch.

Discussion
----------

LoggingTranslator should implement Symfony\Contracts\Translation\TranslatorInterface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29089
| License       | MIT

While autowiring Translator using `Symfony\Contracts\Translation\TranslatorInterface` symfony complains that wrong service was injected, because LoggingTranslator does not implement new interface.

Commits
-------

65f321f LoggingTranslator should implement Symfony\Contracts\Translation\TranslatorInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants