【发布时间】:2019-05-16 04:30:25
【问题描述】:
自从从 4.1.8 更新到 Symfony 4.2 后,我不断收到以下错误:
22:00:39 CRITICAL [php] Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct() must be an instance of Sonata\CoreBundle\Model\Adapter\AdapterInterface, instance of Sonata\Doctrine\Adapter\AdapterChain given, called in /home/kostya/projects/php/www/hillel/sf_store/var/cache/dev/ContainerOrMv7ZL/srcApp_KernelDevDebugContainer.php on line 1265 ["exception" => Symfony\Component\Debug\Exception\FatalThrowableError { …}]
!!
!! In TemplateExtension.php line 40:
!!
!! Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct()
!! must be an instance of Sonata\CoreBundle\Model\Adapter\AdapterInterface, i
!! nstance of Sonata\Doctrine\Adapter\AdapterChain given, called in /home/kost
!! ya/projects/php/www/hillel/sf_store/var/cache/dev/ContainerOrMv7ZL/srcApp_K
!! ernelDevDebugContainer.php on line 1265
有人知道如何解决吗?
【问题讨论】:
-
接口期望类为参数 3 接收什么? (Sonata\CoreBundle\Model\Adapter\AdapterInterface) 字符串、整数、数组、对象、布尔值等。
-
我认为这是更新 symfony 时的错误。我也面临这个问题。但还没有解决。该错误可能在 sonata-project/core-bundle (3.13.2)
标签: php symfony sonata twig-extension