Symfony 从dev到prod的过程在添加项目容器方面产生了差异

Symfony 从dev到prod的过程在添加项目容器方面产生了差异,symfony,command-line,containers,Symfony,Command Line,Containers,我创建了一个新的命令行。命令行的代码调用名为BatchManager的业务管理器类 下面是BatchManager类的构造函数: public function __construct(\Doctrine\Bundle\DoctrineBundle\Registry $doctrine, $mailer, \Symfony\Component\Translation\TranslatorInterface $translator, \Symfony\Bundle

我创建了一个新的命令行。命令行的代码调用名为BatchManager的业务管理器类

下面是BatchManager类的构造函数:

public function __construct(\Doctrine\Bundle\DoctrineBundle\Registry $doctrine, $mailer, 
        \Symfony\Component\Translation\TranslatorInterface $translator,
        \Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine $templating,
        $superUserCivilite, $superUserNom, $superUserCourriel)
下面是将BatchManager类声明为服务的service.yml

 batch_manager:
    class: %batch_manager_class%
    arguments: [@doctrine, @mailer, @translator, @templating, %super_user_civility%, %super_user_name%, %super_user_email%]
在开发模式下没有问题,但当我在命令行中添加--env=prod以调用生产模式时,出现了一个异常:

Fatal error : argument 4 passed to BatchManager::construct() must be an instance of  \Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine, instance of Symfony/Bundle/Twig... (I cannot read the rest) instead..
发生了什么事


感谢您的帮助

您正在批处理管理器::u construct()中键入调试(dev)版本,该版本在生产环境(或调试设置为false的任何其他环境)中不可用

您应该改用接口(
\Symfony\Bundle\FrameworkBundle\Templating\EngineInterface