Skip to content

Commit 9261cd1

Browse files
committed
Adding the "length" question for the string type
1 parent 9c5a786 commit 9261cd1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ install:
5050
- ./vendor/bin/simple-phpunit install
5151

5252
test_script:
53-
- ./vendor/bin/simple-phpunit --group=functional_group1 --stop-on-error
54-
- ./vendor/bin/simple-phpunit --group=functional_group2 --stop-on-error
53+
- ./vendor/bin/simple-phpunit --group=functional_group1
54+
- ./vendor/bin/simple-phpunit --group=functional_group2
5555
- ./vendor/bin/simple-phpunit --exclude-group=functional_group1,functional_group2

src/Maker/MakeEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ private function askForNextField(ConsoleStyle $io, array $fields, string $entity
351351
$data = ['fieldName' => $fieldName, 'type' => $type];
352352
if ('string' == $type) {
353353
// default to 255, avoid the question
354-
$data['length'] = 255;
354+
$data['length'] = $io->ask('Field length', 255, [Validator::class, 'validateLength']);;
355355
} elseif ('decimal' === $type) {
356356
// 10 is the default value given in \Doctrine\DBAL\Schema\Column::$_precision
357357
$data['precision'] = $io->ask('Precision (total number of digits stored: 100.00 would be 5)', 10, [Validator::class, 'validatePrecision']);

tests/Maker/FunctionalTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ public function getCommandEntityTests()
307307
// add not additional fields
308308
'name',
309309
'string',
310+
'', // length (default 255)
310311
// nullable
311312
'y',
312313
'createdAt',
@@ -332,6 +333,7 @@ public function getCommandEntityTests()
332333
// add additional fields
333334
'lastName',
334335
'string',
336+
'', // length (default 255)
335337
// nullable
336338
'y',
337339
// finish adding fields
@@ -681,6 +683,7 @@ public function getCommandEntityTests()
681683
// field name
682684
'firstName',
683685
'string',
686+
'', // length (default 255)
684687
// nullable
685688
'',
686689
// finish adding fields

0 commit comments

Comments
 (0)