0

我遇到了 phpstan 给我带来的错误问题。这是关于 datafixtures.php 文件中的加载方法。这是错误:

 Parameter #1 $manager (Doctrine\Persistence\ObjectManager) of method App\AppFixtures\DataFixtures::load() is
         not compatible with parameter #1 $manager (Doctrine\Persistence\ObjectManager) of method
         Doctrine\Common\DataFixtures\FixtureInterface::load().

使用以下代码:

public function load(ObjectManager $manager): void
    {
        $this->updateCompanies();

        $this->loadEventCategories();

        $this->loadEvents();

        $this->loadNotifications();

        $this->manager->flush();

        $this->updateEvent();

        $this->createApiTokens();

        $this->manager->flush();
    }

当我试图忽略错误时,据说没有错误,并且在它带来与上述相同的错误之后。那么,如果有人知道如何纠正错误或忽略?

4

0 回答 0