Skip to content
Closed
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
115 changes: 115 additions & 0 deletions config/sets/symfony/composer-based.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@
use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector;
use Rector\Transform\Rector\ClassMethod\WrapReturnRector;
use Rector\Transform\Rector\StaticCall\StaticCallToNewRector;
use Rector\Transform\Rector\String_\StringToClassConstantRector;
use Rector\Transform\ValueObject\AttributeKeyToClassConstFetch;
use Rector\Transform\ValueObject\StaticCallToNew;
use Rector\Transform\ValueObject\StringToClassConstant;
use Rector\Transform\ValueObject\WrapReturn;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
Expand Down Expand Up @@ -2947,6 +2949,86 @@
'Symfony\Component\Validator\Constraints\ExpressionLanguageSyntaxValidator' => 'Symfony\Component\Validator\Constraints\ExpressionSyntaxValidator',
], 'symfony/validator', '>=6.1');

// symfony/routing 6.1
$rectorConfig->ruleWithConfigurationComposerVersionBound(
StringToClassConstantRector::class,
[
new StringToClassConstant(
'[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*',
'Symfony\Component\Routing\Requirement\Requirement',
'ASCII_SLUG'
),
new StringToClassConstant(
'[0-9]{4}-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|(?<!02-)3[01])',
'Symfony\Component\Routing\Requirement\Requirement',
'DATE_YMD'
),
new StringToClassConstant(
'[0-9A-HJKMNP-TV-Z]{26}',
'Symfony\Component\Routing\Requirement\Requirement',
'UID_BASE32'
),
new StringToClassConstant(
'[1-9A-HJ-NP-Za-km-z]{22}',
'Symfony\Component\Routing\Requirement\Requirement',
'UID_BASE58'
),
new StringToClassConstant(
'[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UID_RFC4122'
),
new StringToClassConstant(
'[0-7][0-9A-HJKMNP-TV-Z]{25}',
'Symfony\Component\Routing\Requirement\Requirement',
'ULID'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-[13-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V1'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V3'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V4'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V5'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-6[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V6'
),

new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V7'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V8'
),
],
'symfony/routing',
'>=6.1',
);

// symfony/console 6.2
$rectorConfig->ruleWithConfigurationComposerVersionBound(AddReturnTypeDeclarationRector::class, [
// @see https://github.com/symfony/symfony/pull/49347
Expand Down Expand Up @@ -3090,6 +3172,25 @@
'Symfony\Component\Messenger\Transport\InMemoryTransportFactory' => 'Symfony\Component\Messenger\Transport\InMemory\InMemoryTransportFactory',
], 'symfony/messenger', '>=6.3');

// symfony/routing 6.2
$rectorConfig->ruleWithConfigurationComposerVersionBound(
StringToClassConstantRector::class,
[
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V7'
),
new StringToClassConstant(
'[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}',
'Symfony\Component\Routing\Requirement\Requirement',
'UUID_V8'
),
],
'symfony/routing',
'>=6.2',
);

// symfony/web-link 6.3
$rectorConfig->ruleWithConfigurationComposerVersionBound(ReplaceArgumentDefaultValueRector::class, [
new ReplaceArgumentDefaultValue(
Expand Down Expand Up @@ -3952,6 +4053,20 @@
'Symfony\Component\Translation\Test\ProviderFactoryTestCase' => 'Symfony\Component\Translation\Test\AbstractProviderFactoryTestCase',
], 'symfony/translation', '>=7.2');

// symfony/routing 7.3
$rectorConfig->ruleWithConfigurationComposerVersionBound(
StringToClassConstantRector::class,
[
new StringToClassConstant(
'[0-9a-f]{24}',
'Symfony\Component\Routing\Requirement\Requirement',
'MONGODB_ID'
),
],
'symfony/routing',
'>=7.3',
);

// symfony/console 7.4
$rectorConfig->ruleWithConfigurationComposerVersionBound(RenameMethodRector::class, [
new MethodCallRename('Symfony\Component\Console\Application', 'add', 'addCommand'),
Expand Down
Loading