Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make:entity error: In DoctrineHelper.php line 314: Warning: Invalid argument supplied for foreach() #1001

Closed
amonkonanBYF opened this issue Oct 29, 2021 · 2 comments
Labels
Bug Bug Fix

Comments

@amonkonanBYF
Copy link

Hi teams,

I've tried to create a new entity in an existing project in

symfony 4.3.11
composer 2.1.9
php 7.1.3
> Class name of the entity to create or update (e.g. DeliciousPizza):
>  > toto
> 
>  Mark this class as an API Platform resource (expose a CRUD API for it) (yes/no) [no]:
>  > yes
> 
> In DoctrineHelper.php line 314:
> 
>   Warning: Invalid argument supplied for foreach()
> 

composer.json

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "api-platform/core": "^2.5",
        "aws/aws-sdk-php": "^3.89",
        "cocur/slugify": "^4.0",
        "csa/guzzle-bundle": "^3.1",
        "doctrine/annotations": "^1.0",
        "doctrine/doctrine-bundle": "1.11",
        "doctrine/doctrine-migrations-bundle": "^2.0",
        "doctrine/orm": "^2.7",
        "hidehalo/nanoid-php": "^1.1",
        "jms/serializer-bundle": "^3.6",
        "knplabs/knp-gaufrette-bundle": "^0.5.3",
        "league/flysystem-bundle": "^1.5",
        "lexik/jwt-authentication-bundle": "^2.6",
        "liip/imagine-bundle": "^2.2",
        "mikehaertl/php-pdftk": "^0.9.1",
        "nelmio/cors-bundle": "^2.1",
        "phpdocumentor/reflection-docblock": "^5.2",
        "phpoffice/phpspreadsheet": "^1.15",
        "phpoffice/phpword": "^0.18.2",
        "sensio/framework-extra-bundle": "^5.2",
        "spatie/dropbox-api": "^1.17",
        "spatie/flysystem-dropbox": "^1.2",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "4.3.*",
        "symfony/console": "4.3.*",
        "symfony/dotenv": "4.3.*",
        "symfony/event-dispatcher": "4.3.*",
        "symfony/expression-language": "4.3.*",
        "symfony/flex": "^1.1",
        "symfony/form": "4.3.*",
        "symfony/framework-bundle": "4.3.*",
        "symfony/http-client": "4.3.*",
        "symfony/ldap": "4.3.*",
        "symfony/monolog-bundle": "^3.5",
        "symfony/property-access": "4.3.*",
        "symfony/property-info": "4.3.*",
        "symfony/security-bundle": "4.3.*",
        "symfony/serializer": "4.3.*",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/translation": "4.3.*",
        "symfony/twig-bundle": "4.3.*",
        "symfony/validator": "4.3.*",
        "symfony/yaml": "4.3.*",
        "vich/uploader-bundle": "^1.9",
        "webonyx/graphql-php": "^0.13.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.3.*"
        }
    },
    "require-dev": {
        "dama/doctrine-test-bundle": "^6.3",
        "doctrine/doctrine-fixtures-bundle": "^3.3",
        "guzzlehttp/guzzle": "^6.5",
        "symfony/browser-kit": "4.3.*",
        "symfony/css-selector": "4.3.*",
        "symfony/maker-bundle": "^1.15",
        "symfony/phpunit-bridge": "^5.0",
        "symfony/stopwatch": "4.3.*",
        "symfony/web-profiler-bundle": "4.3.*",
        "symfony/web-server-bundle": "4.3.*"
    }
}
@twin-elements
Copy link

Install symfony/maker-bundle version 1.33. *.
"symfony/maker-bundle": "1.33.*",
Should help.

@sdaoudi
Copy link

sdaoudi commented Jan 7, 2022

Already fixed in #993

Upgrade to "symfony/maker-bundle": "1.36.*" to fix it

@OskarStark OskarStark added the Bug Bug Fix label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix
Projects
None yet
Development

No branches or pull requests

5 participants