php - 无法加载 Symfony\Bridge\Doctrine\RegistryInterface
问题描述
我想在新计算机上使用我的应用程序,所以我从 Git 中提取所有内容并重新启动composer
,并yarn
获取我所有的第三方包和库。
运行时composer update
出现以下错误:
无法自动装配服务“App\Repository\BlogPostRepository”:方法“__construct()”的参数“$registry”引用接口“Symfony\Bridge\Doctrine\RegistryInterface”,但不存在此类服务。尝试将类型提示更改为“Doctrine\Common\Persistence\ManagerRegistry”。
我的 `BlogRepository 是
namespace App\Repository;
use App\Entity\BlogPost;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method BlogPost|null find($id, $lockMode = null, $lockVersion = null)
* @method BlogPost|null findOneBy(array $criteria, array $orderBy = null)
* @method BlogPost[] findAll()
* @method BlogPost[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class BlogPostRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, BlogPost::class);
}
}
它是由 symfony 自动生成的,我从未更改过它。这是一个错误还是composer-update
改变了一切?
解决方案
推荐阅读
- c++ - 一个可由 1 个线程访问的数组,可以返回其他线程请求的数据
- nuxt.js - Nuxt 与 LocomotiveScroll 和 Gsap
- windows - 批处理脚本函数调用工作不正常
- vb6 - 与较新版本的 tlb 相关的 Microsoft Visual Basic 6 警告
- database - 文件“3050/var/lib/firebird/data/corp”的 CreateFile(打开)操作期间出现 I/O 错误。该系统找不到指定的路径
- java - 用java编写插入排序算法
- python - 使用 pandas 数据框应用来替换 numpy 数组中的行值
- python - 按国家分组计数操作,在 python 中返回数据框
- laravel - ErrorException 未定义的偏移量:Laravel API 中的 0
- flutter - Flutter 地址自动填充