symfony Fatal error: Declaration of AppDataFixturesAppFixtures::load(DoctrineCommonPersistence

373次阅读
没有评论

报错:

 Fatal error: Declaration of AppDataFixturesAppFixtures::load(DoctrineCommonPersistenceObjectManager $manager) must be compatible with DoctrineCommonDataFixturesFixtureInterface::load(DoctrinePersistenceObjectManager $manager) in E:wamp64wwwvrPlatformsrcDataFixturesAppFixtures.php on line 8
 

问题背景:

symfony项目 composer update 后

解决:

  1. 删除 srcDataFixtures目录
  2. bin/console cache:clear
  3. use DoctrineCommonPersistenceManagerRegistry;
    改为:
    use DoctrinePersistenceManagerRegistry;
    
    // 参考:https://stackoverflow.com/questions/63688919/error-argument-1-passed-to-app-repository-foorepository-construct-must-be

原因:

symfony版本差异

 

 

 

facingscreen
版权声明:本站原创文章,由 facingscreen2022-08-12发表,共计578字。
转载说明:本文为搜栈网原创文章,除特殊说明外皆由CC-4.0协议发布,转载请注明出处,如有帮助欢迎打赏。
评论(没有评论)
验证码