0

I have a problem with an error that phpstan brings me up. It's about a load method in a datafixtures.php files. Here is the error :

 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().

With the following code :

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

        $this->loadEventCategories();

        $this->loadEvents();

        $this->loadNotifications();

        $this->manager->flush();

        $this->updateEvent();

        $this->createApiTokens();

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

When I tried to ignore the error, it's said that there is no error and right after it brings the same error than above. So if someone know how to correct the error or ignore ?

2
  • Hi, this looks like a PHPStan bug. Are you on the latest version (0.12.65)? Commented Jan 6, 2021 at 21:13
  • Hi, yes I'm on the latest version. But, I found out the problem, it's was just an incorrect use. Commented Jan 7, 2021 at 8:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.