App\Proxy\EntityManagerProxy:
decorates: 'doctrine.orm.entity_manager'services:
App\Mailer: ~
App\DecoratingMailer:
decorates: App\Mailer
# pass the old service as an argument
arguments: ['@.inner']services:
Doctrine\ORM\EntityManagerInterface: ~
App\Proxy\EntityManagerProxy:
decorates: Doctrine\ORM\EntityManagerInterface
arguments: ['@.inner']Error: Cannot instantiate interface Doctrine\ORM\EntityManagerInterface
Где у вас декоратор, который будет передаваться в нужный сервис?
Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "Doctrine\ORM\EntityManagerInterface": argument "$entityManager" of method "App\Proxy\EntityManagerProxy::__construct()" references class "Doctrine\ORM\EntityManager" but no such service exists. Try changing the type-hint to "Doctrine\ORM\EntityManagerInterface" instead.
Doctrine\ORM\EntityManagerInterface:
public: true
class: App\Proxy\EntityManagerProxy
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "Doctrine\ORM\EntityManagerInterface", path: "Doctrine\ORM\EntityManagerInterface -> Doctrine\ORM\EntityManagerInterface".
Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "Doctrine\ORM\EntityManagerInterface": argument "$entityManager" of method "App\Proxy\EntityManagerProxy::__construct()" references class "Doctrine\ORM\EntityManager" but no such service exists. Try changing the type-hint to "Doctrine\ORM\EntityManagerInterface" instead.
Просто интересно, для чего тебе это?