2

我已将 Symfony 从 3.2 升级到 3.3。我读过这个:https ://github.com/symfony/symfony/blob/master/UPGRADE-3.3.md

但是现在,我有这个错误:

类型错误:传递给 AppBundle\EventListener\ForumListener::__construct() 的参数 2 必须是 Symfony\Component\Cache\Adapter\FilesystemAdapter 的实例,给定 Symfony\Component\Cache\Adapter\TraceableAdapter 的实例,在 /var/ 中调用www/symfony/WikiSport/var/cache/dev/appDevDebugProjectContainer.php 第 612 行

我不明白,因为在 UPGRADE-3.3.md 中,没有 FilesystemAdapter 或 TraceableAdapter 的信息。

论坛监听器.php:

use Symfony\Component\Cache\Adapter\FilesystemAdapter;

class ForumListener
{
    private $cache;

    public function __construct(EntityManager $entityManager, FilesystemAdapter $cache)
    {
        $this->entityManager = $entityManager;
        $this->cache = $cache;
    }

和 services.yml :

app.forum_listener:
    class: AppBundle\EventListener\ForumListener
    autowire: true
    public: true
    tags:
        - { name: kernel.event_listener, event: kernel.controller, method: onKernelController }

你能帮助我吗 ?非常感谢 :)

4

0 回答 0