Skip to content

Commit 6c55d3f

Browse files
committed
[make:entity] ask() doesnt accept "int" only "string"
stop relying on type casting - just use a string
1 parent bc58880 commit 6c55d3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Maker/MakeEntity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private function askForNextField(ConsoleStyle $io, array $fields, string $entity
422422

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

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

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

0 commit comments

Comments
 (0)