Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve uuid steps #2125

Merged
merged 2 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/run_all_sets.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@


$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;
Expand Down
4 changes: 1 addition & 3 deletions config/set/doctrine/doctrine-id-to-uuid-step-1.yaml
Original file line number Diff line number Diff line change
@@ -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: ~
11 changes: 3 additions & 8 deletions config/set/doctrine/doctrine-id-to-uuid-step-2.yaml
Original file line number Diff line number Diff line change
@@ -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: ~
14 changes: 7 additions & 7 deletions config/set/doctrine/doctrine-id-to-uuid-step-3.yaml
Original file line number Diff line number Diff line change
@@ -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: ~
9 changes: 9 additions & 0 deletions config/set/doctrine/doctrine-id-to-uuid-step-4.yaml
Original file line number Diff line number Diff line change
@@ -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: ~
12 changes: 0 additions & 12 deletions config/set/doctrine/doctrine-id-to-uuid.yaml

This file was deleted.