与制造商捆绑包和注册表不兼容-SYMFONY [英] Incompatibility with maker bundle and Registry - SYMFONY

查看:32
本文介绍了与制造商捆绑包和注册表不兼容-SYMFONY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Symfony的新手,并且正在创建一个供个人使用的博客.但是,当我尝试使用命令 php bin/console make:entity 将字段添加到实体时,会弹出错误消息.

I'm new to Symfony and I'm creating a blog for personal use. But when I try to add fields to an entity using the command php bin/console make:entity an error pops out.

传递给Symfony \ Bundle \ MakerBundle \ Validator :: validateDoctrineFieldName()的参数2必须是的实例Doctrine \ Common \ Persistence \ ManagerRegistry,指定的Doctrine \ Bundle \ DoctrineBundle \ Registry实例,调用在C:\ Users \ user \ Documents \ CODING \ Symfony \ calidad \ vendor \ symfony \ maker-bundle \ src \ Maker \ MakeEntity.p中编辑hp在303行

Argument 2 passed to Symfony\Bundle\MakerBundle\Validator::validateDoctrineFieldName() must be an instance of Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\DoctrineBundle\Registry given, call ed in C:\Users\user\Documents\CODING\Symfony\calidad\vendor\symfony\maker-bundle\src\Maker\MakeEntity.p hp on line 303

很高兴您能提供所有帮助.

I would gladly appreciate all of your help.

它允许我创建一个实体,但不能添加字段.

It lets me create an entity, but not adding fields.

在这里粘贴我的composer.json:

Here I paste my composer.json:

"require": {
    "php": ">=7.1.3",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "composer/package-versions-deprecated": "^1.11",
    "doctrine/doctrine-bundle": "^2.1",
    "doctrine/doctrine-migrations-bundle": "^3.0",
    "doctrine/orm": "^2.7",
    "sensio/framework-extra-bundle": "^5.6",
    "symfony/asset": "4.4.*",
    "symfony/console": "4.4.*",
    "symfony/dotenv": "4.4.*",
    "symfony/flex": "^1.3.1",
    "symfony/framework-bundle": "4.4.*",
    "symfony/twig-bundle": "4.4.*",
    "symfony/web-server-bundle": "4.4.*",
    "symfony/yaml": "4.4.*",
    "twig/extra-bundle": "^2.12|^3.0",
    "twig/twig": "^2.12|^3.0"
},
"require-dev": {
    "sensiolabs/security-checker": "^6.0",
    "symfony/debug-bundle": "^4.4",
    "symfony/maker-bundle": "^1.20",
    "symfony/monolog-bundle": "^3.0",
    "symfony/stopwatch": "^4.4",
    "symfony/twig-bundle": "^4.4",
    "symfony/var-dumper": "^4.4",
    "symfony/web-profiler-bundle": "^4.4"
},

谢谢!

推荐答案

这是由于symfony作曲家配置文件中的信息不正确

This is due to incorrect information in the symfony composer configuration file

为解决此问题,请在安装symfony后重新输入此说明.

To solve the problem, re-enter this instruction after installing symfony.

此命令解决了您的问题.撰写者需要symfony/maker-bundle --dev

This command solves your problem. composer require symfony/maker-bundle --dev

这篇关于与制造商捆绑包和注册表不兼容-SYMFONY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆