简体   繁体   中英

Incompatibility with maker bundle and Registry - SYMFONY

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!

这是doctrine/doctrine-bundle v2.1.1 中的一个错误 - 确保安装了以前的版本 v2.1.0 或更新的版本 v2.1.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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM