improve uuid steps (#2125)

improve uuid steps
This commit is contained in:
Tomáš Votruba 2019-10-09 11:23:12 +01:00 committed by GitHub
commit 800ad48659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 31 deletions

View File

@ -27,10 +27,10 @@ foreach ($setProvider->provide() as $setName) {
$process = new Process($command, __DIR__ . '/..');
echo sprintf('Set "%s" is OK' . PHP_EOL, $setName);
try {
$process->mustRun();
echo sprintf('Set "%s" is OK' . PHP_EOL, $setName);
} catch (ProcessFailedException $processFailedException) {
if (! Strings::match($processFailedException->getMessage(), '#(Fatal error)|(\[ERROR\])#')) {
continue;

View File

@ -1,5 +1,3 @@
services:
# first, run these rule → then look at step-1
# add uuid id property
Rector\Doctrine\Rector\Class_\AddUuidToEntityWhereMissingRector: ~
Rector\Doctrine\Rector\Class_\AddUuidMirrorForRelationPropertyRector: ~
Rector\Doctrine\Rector\Class_\AlwaysInitializeUuidInEntityRector: ~

View File

@ -1,9 +1,4 @@
services:
# properties
Rector\Doctrine\Rector\Property\AddUuidAnnotationsToIdPropertyRector: ~
Rector\Doctrine\Rector\Property\RemoveTemporaryUuidColumnPropertyRector: ~
Rector\Doctrine\Rector\Property\RemoveTemporaryUuidRelationPropertyRector: ~
# methods
Rector\Doctrine\Rector\ClassMethod\ChangeGetIdTypeToUuidRector: ~
Rector\Doctrine\Rector\ClassMethod\ChangeSetIdTypeToUuidRector: ~
# add relations uuid properties
Rector\Doctrine\Rector\Class_\AddUuidMirrorForRelationPropertyRector: ~
Rector\Doctrine\Rector\Class_\AlwaysInitializeUuidInEntityRector: ~

View File

@ -1,9 +1,9 @@
services:
Rector\Doctrine\Rector\MethodCall\ChangeSetIdToUuidValueRector: ~
Rector\Doctrine\Rector\MethodCall\ChangeGetUuidMethodCallToGetIdRector: ~
Rector\Doctrine\Rector\ClassMethod\ChangeReturnTypeOfClassMethodWithGetIdRector: ~
Rector\Doctrine\Rector\Identical\ChangeIdenticalUuidToEqualsMethodCallRector: ~
# properties
Rector\Doctrine\Rector\Property\AddUuidAnnotationsToIdPropertyRector: ~
Rector\Doctrine\Rector\Property\RemoveTemporaryUuidColumnPropertyRector: ~
Rector\Doctrine\Rector\Property\RemoveTemporaryUuidRelationPropertyRector: ~
# add Uuid type declarations
Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedParamTypeRector: ~
Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector: ~
# methods
Rector\Doctrine\Rector\ClassMethod\ChangeGetIdTypeToUuidRector: ~
Rector\Doctrine\Rector\ClassMethod\ChangeSetIdTypeToUuidRector: ~

View File

@ -0,0 +1,9 @@
services:
Rector\Doctrine\Rector\MethodCall\ChangeSetIdToUuidValueRector: ~
Rector\Doctrine\Rector\MethodCall\ChangeGetUuidMethodCallToGetIdRector: ~
Rector\Doctrine\Rector\ClassMethod\ChangeReturnTypeOfClassMethodWithGetIdRector: ~
Rector\Doctrine\Rector\Identical\ChangeIdenticalUuidToEqualsMethodCallRector: ~
# add Uuid type declarations
Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedParamTypeRector: ~
Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector: ~

View File

@ -1,12 +0,0 @@
services:
# first, run this rule
Rector\Doctrine\Rector\Class_\AddUuidToEntityWhereMissingRector: ~
# second, diff and migrate wih Doctrine
# third, run this rule
# Rector\Doctrine\Rector\Class_\AddUuidMirrorForRelationPropertyRector: ~
# fourth, diff and migrate wih Doctrine
# then run this to validate the change: bin/console doctrine:schema:update --dump-sql