私はsymfony2を使用しています.1つのサービスを使用して、システムの何らかのアクションに基づいてユーザーに通知します. まあ、それは私のローカル環境ではかなりうまくいきましたが、現在は本番環境で問題が発生しています。
サービスは、次のように services.txt で dlecare されます。
mybundle.notify:
class: NC8Digital\CRMBundle\Services\Notify
arguments: [ @doctrine.orm.entity_manager, @templating, @mailer ]
そして、クラスは次のように宣言されています
public function __construct(EntityManager $em, TimedTwigEngine $templating, \Swift_Mailer $mailer)
そして、私はこのエラーを受け取っています:
PHP Catchable fatal error: Argument 2 passed to NC8Digital\\CRMBundle\\Services\\Notify::__construct() must be an instance of Symfony\\Bundle\\TwigBundle\\Debug\\TimedTwigEngine, instance of Symfony\\Bundle\\TwigBundle\\TwigEngine given, called in /mypath/app/cache/prod/appProdProjectContainer.php on line 367 and defined in /mypath/src/NC8Digital/CRMBundle/Services/Notify.php on line 43
私が最初に試みたのは、コンストラクターを変更して問題を解決することでした...ブラウザーで500エラーが発生したため、元に戻しました。