Incompatibility with maker bundle and Registry - SYMFONY

为君一笑 提交于 2021-02-08 06:56:27

问题


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.

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.

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"
},

Thanks!


回答1:


That's a bug in doctrine/doctrine-bundle v2.1.1 - make sure to have either the former version v2.1.0 or the later one, v2.1.2, installed.




回答2:


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

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

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



来源:https://stackoverflow.com/questions/63582492/incompatibility-with-maker-bundle-and-registry-symfony

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!