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'm trying to get a producer in the controller, for further work with him. By passing Producer class to the constructor, i get a type error, since in the test environment, the traceable_producer: true is set in the config, and in the standard traceable_producer: false.
If i pass ProducerInterface, i get a RuntimeException.
Full exception text "Cannot autowire service "App\Controller\TestController": argument "$producer" of method "__construct()" references interface "Enqueue\Client\ProducerInterface" but no such service exists. It cannot be auto-registered because it is from a different root namespace. Did you create a class that implements this interface?"
This behavior is fixed by adding to the services.yml the line Enqueue \ Client \ ProducerInterface: '@ enqueue.producer
but it seems to me that this is not the best way to work out of the box.
Thanks!
The text was updated successfully, but these errors were encountered:
I using enqueue/enqueue-bundle in symfony 4
I'm trying to get a producer in the controller, for further work with him. By passing Producer class to the constructor, i get a type error, since in the test environment, the traceable_producer: true is set in the config, and in the standard traceable_producer: false.
If i pass ProducerInterface, i get a RuntimeException.
Full exception text "Cannot autowire service "App\Controller\TestController": argument "$producer" of method "__construct()" references interface "Enqueue\Client\ProducerInterface" but no such service exists. It cannot be auto-registered because it is from a different root namespace. Did you create a class that implements this interface?"
This behavior is fixed by adding to the services.yml the line
Enqueue \ Client \ ProducerInterface: '@ enqueue.producer
but it seems to me that this is not the best way to work out of the box.
Thanks!
The text was updated successfully, but these errors were encountered: