Skip to content

Commit

Permalink
minor #1503 [make:entity] ask() doesnt accept "int" only "string"
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Apr 4, 2024
1 parent c8d5e0d commit 5bf40ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Maker/MakeEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,13 @@ private function askForNextField(ConsoleStyle $io, array $fields, string $entity

if ('string' === $type) {
// default to 255, avoid the question
$classProperty->length = $io->ask('Field length', 255, Validator::validateLength(...));
$classProperty->length = $io->ask('Field length', '255', Validator::validateLength(...));
} elseif ('decimal' === $type) {
// 10 is the default value given in \Doctrine\DBAL\Schema\Column::$_precision
$classProperty->precision = $io->ask('Precision (total number of digits stored: 100.00 would be 5)', 10, Validator::validatePrecision(...));
$classProperty->precision = $io->ask('Precision (total number of digits stored: 100.00 would be 5)', '10', Validator::validatePrecision(...));

// 0 is the default value given in \Doctrine\DBAL\Schema\Column::$_scale
$classProperty->scale = $io->ask('Scale (number of decimals to store: 100.00 would be 2)', 0, Validator::validateScale(...));
$classProperty->scale = $io->ask('Scale (number of decimals to store: 100.00 would be 2)', '0', Validator::validateScale(...));
}

if ($io->confirm('Can this field be null in the database (nullable)', false)) {
Expand Down

0 comments on commit 5bf40ae

Please sign in to comment.