cakephp-fixture-factories
cakephp-fixture-factories copied to clipboard
PersistCommand and number argument: default value should be a string
Description of the problem
Console Input Options does not support mixed value anymore. Only string, bool and null. So if you try the command you get the following error:
Cake\Console\ConsoleInputOption::__construct(): Argument #5 ($default) must be of type string|bool|null, int given
Versions
Cakephp: 5.0.6 Cakephp-fixture-factories: 3.0.2
Possible solution
In src/Command/PersistCommand.php line 65
Replace
->addOption('number', [ 'help' => 'Number of entities to persist.', 'short' => 'n', 'default' => 1, ])
With
->addOption('number', [ 'help' => 'Number of entities to persist.', 'short' => 'n', 'default' => '1', ])