From 6c55d3f6a5f47dc9d9cf64933aa8c5eea8441662 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 2 Apr 2024 19:10:14 -0400 Subject: [PATCH] [make:entity] ask() doesnt accept "int" only "string" stop relying on type casting - just use a string --- src/Maker/MakeEntity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Maker/MakeEntity.php b/src/Maker/MakeEntity.php index 41f0287fb1..f87233fb97 100644 --- a/src/Maker/MakeEntity.php +++ b/src/Maker/MakeEntity.php @@ -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)) {