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

group delivered as string but not array #301

Open
idoraquel opened this issue Dec 26, 2019 · 0 comments
Open

group delivered as string but not array #301

idoraquel opened this issue Dec 26, 2019 · 0 comments

Comments

@idoraquel
Copy link

[2019-12-26 12:12:03] console.ERROR: Error thrown while running command "doctrine:fixtures:load --em=platform --append --group=platform". Message: "Argument 1 passed to Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader::getFixtures() must be of the type array, string given, called in /opt/project/backend/vendor/doctrine/doctrine-fixtures-bundle/Command/LoadDataFixturesDoctrineCommand.php on line 116" {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Doctrine\\Bundle\\FixturesBundle\\Loader\\SymfonyFixturesLoader::getFixtures() must be of the type array, string given, called in /opt/project/backend/vendor/doctrine/doctrine-fixtures-bundle/Command/LoadDataFixturesDoctrineCommand.php on line 116 at /opt/project/backend/vendor/doctrine/doctrine-fixtures-bundle/Loader/SymfonyFixturesLoader.php:93)","command":"doctrine:fixtures:load --em=platform --append --group=platform","message":"Argument 1 passed to Doctrine\\Bundle\\FixturesBundle\\Loader\\SymfonyFixturesLoader::getFixtures() must be of the type array, string given, called in /opt/project/backend/vendor/doctrine/doctrine-fixtures-bundle/Command/LoadDataFixturesDoctrineCommand.php on line 116"} []

The main inconsistency here is actually in lines:

$groups   = $input->getOption('group');
$fixtures = $this->fixturesLoader->getFixtures($groups);

$input->getOption returns mixed
However ::getFixtures method allows to pass groups only as an array

public function getFixtures(array $groups = []) : array

It is a quite simple fix, i will prepare a pull request for that in a minute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant