Skip to content

Commit b3986f0

Browse files
authored
Merge pull request #1145 from wucdbm/patch-1
Support --skip-property-types of ValidateSchemaCommand
2 parents a265d52 + 4ce0156 commit b3986f0

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

doc/tasks/doctrine_orm.md

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ grumphp:
1010
doctrine_orm:
1111
skip_mapping: false
1212
skip_sync: false
13+
skip_property_types: false
1314
triggered_by: ['php', 'xml', 'yml']
1415
```
1516
@@ -25,6 +26,12 @@ With this parameter you can skip the mapping validation check.
2526
2627
With this parameter you can skip checking if the mapping is in sync with the database.
2728
29+
**skip_property_types**
30+
31+
*Default: false*
32+
33+
With this parameter you can skip checking if Entity field property types match the Doctrine types.
34+
2835
**triggered_by**
2936
3037
*Default: [php, xml, yml]*

src/Task/DoctrineOrm.php

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static function getConfigurableOptions(): ConfigOptionsResolver
2424
$resolver->setDefaults([
2525
'skip_mapping' => false,
2626
'skip_sync' => false,
27+
'skip_property_types' => false,
2728
'triggered_by' => ['php', 'xml', 'yml'],
2829
]);
2930

@@ -58,6 +59,7 @@ public function run(ContextInterface $context): TaskResultInterface
5859
$arguments->add('orm:validate-schema');
5960
$arguments->addOptionalArgument('--skip-mapping', $config['skip_mapping']);
6061
$arguments->addOptionalArgument('--skip-sync', $config['skip_sync']);
62+
$arguments->addOptionalArgument('--skip-property-types', $config['skip_property_types']);
6163

6264
$process = $this->processBuilder->buildProcess($arguments);
6365

test/Unit/Task/DoctrineOrmTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function provideConfigurableOptions(): iterable
2525
yield 'defaults' => [
2626
[],
2727
[
28+
'skip_property_types' => false,
2829
'skip_mapping' => false,
2930
'skip_sync' => false,
3031
'triggered_by' => ['php', 'xml', 'yml'],
@@ -120,5 +121,16 @@ public function provideExternalTaskRuns(): iterable
120121
'--skip-sync',
121122
]
122123
];
124+
yield 'skip-property-types' => [
125+
[
126+
'skip_property_types' => true,
127+
],
128+
$this->mockContext(RunContext::class, ['hello.php', 'hello2.php']),
129+
'doctrine',
130+
[
131+
'orm:validate-schema',
132+
'--skip-property-types',
133+
]
134+
];
123135
}
124136
}

0 commit comments

Comments
 (0)