Skip to content

Commit 14d71b6

Browse files
authored
[symfony 61] split of configs per package (#744)
* [symfony 61] split of configs per package * add validator * add validator * add console * add twig bridge
1 parent 37d320e commit 14d71b6

File tree

6 files changed

+88
-21
lines changed

6 files changed

+88
-21
lines changed

config/sets/symfony/symfony6/symfony61.php

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,12 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Renaming\Rector\Name\RenameClassRector;
7-
use Rector\Symfony\Symfony61\Rector\Class_\CommandConfigureToAttributeRector;
8-
use Rector\Symfony\Symfony61\Rector\Class_\CommandPropertyToAttributeRector;
9-
use Rector\Symfony\Symfony61\Rector\Class_\MagicClosureTwigExtensionToNativeMethodsRector;
10-
use Rector\Symfony\Symfony61\Rector\StaticPropertyFetch\ErrorNamesPropertyToConstantRector;
116

127
# https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.1.md
138

149
return static function (RectorConfig $rectorConfig): void {
15-
$rectorConfig->rules([
16-
CommandConfigureToAttributeRector::class,
17-
CommandPropertyToAttributeRector::class,
18-
ErrorNamesPropertyToConstantRector::class,
19-
MagicClosureTwigExtensionToNativeMethodsRector::class,
20-
]);
21-
22-
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
23-
// @see https://github.com/symfony/symfony/pull/43982
24-
'Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface' => 'Symfony\Component\Serializer\Normalizer\DenormalizerInterface',
25-
'Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface' => 'Symfony\Component\Serializer\Normalizer\NormalizerInterface',
26-
// @see https://github.com/symfony/symfony/pull/45623
27-
'Symfony\Component\Validator\Constraints\ExpressionLanguageSyntax' => 'Symfony\Component\Validator\Constraints\ExpressionSyntax',
28-
'Symfony\Component\Validator\Constraints\ExpressionLanguageSyntaxValidator' => 'Symfony\Component\Validator\Constraints\ExpressionSyntaxValidator',
29-
]);
10+
$rectorConfig->import(__DIR__ . '/symfony61/symfony61-serializer.php');
11+
$rectorConfig->import(__DIR__ . '/symfony61/symfony61-validator.php');
12+
$rectorConfig->import(__DIR__ . '/symfony61/symfony61-console.php');
13+
$rectorConfig->import(__DIR__ . '/symfony61/symfony61-twig-bridge.php');
3014
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Symfony\Symfony61\Rector\Class_\CommandConfigureToAttributeRector;
7+
use Rector\Symfony\Symfony61\Rector\Class_\CommandPropertyToAttributeRector;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->rules([
11+
CommandConfigureToAttributeRector::class,
12+
CommandPropertyToAttributeRector::class,
13+
]);
14+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Renaming\Rector\Name\RenameClassRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
10+
// @see https://github.com/symfony/symfony/pull/43982
11+
'Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface' => 'Symfony\Component\Serializer\Normalizer\DenormalizerInterface',
12+
'Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface' => 'Symfony\Component\Serializer\Normalizer\NormalizerInterface',
13+
]);
14+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Symfony\Symfony61\Rector\Class_\MagicClosureTwigExtensionToNativeMethodsRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->rule(MagicClosureTwigExtensionToNativeMethodsRector::class);
10+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Renaming\Rector\Name\RenameClassRector;
7+
use Rector\Symfony\Symfony61\Rector\StaticPropertyFetch\ErrorNamesPropertyToConstantRector;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->rule(ErrorNamesPropertyToConstantRector::class);
11+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
12+
// @see https://github.com/symfony/symfony/pull/45623
13+
'Symfony\Component\Validator\Constraints\ExpressionLanguageSyntax' => 'Symfony\Component\Validator\Constraints\ExpressionSyntax',
14+
'Symfony\Component\Validator\Constraints\ExpressionLanguageSyntaxValidator' => 'Symfony\Component\Validator\Constraints\ExpressionSyntaxValidator',
15+
]);
16+
};

src/Set/SetProvider/Symfony6SetProvider.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,39 @@ public function provide(): array
6868

6969
new ComposerTriggeredSet(
7070
SetGroup::SYMFONY,
71-
'symfony/*',
71+
'symfony/symfony',
7272
'6.1',
7373
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony61.php'
7474
),
75+
76+
new ComposerTriggeredSet(
77+
SetGroup::SYMFONY,
78+
'symfony/serializer',
79+
'6.1',
80+
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony61/symfony61-serializer.php'
81+
),
82+
83+
new ComposerTriggeredSet(
84+
SetGroup::SYMFONY,
85+
'symfony/validator',
86+
'6.1',
87+
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony61/symfony61-validator.php'
88+
),
89+
90+
new ComposerTriggeredSet(
91+
SetGroup::SYMFONY,
92+
'symfony/console',
93+
'6.1',
94+
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony61/symfony61-console.php'
95+
),
96+
97+
new ComposerTriggeredSet(
98+
SetGroup::SYMFONY,
99+
'symfony/twig-bridge',
100+
'6.1',
101+
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony61/symfony61-twig-bridge.php'
102+
),
103+
75104
new ComposerTriggeredSet(
76105
SetGroup::SYMFONY,
77106
'symfony/*',

0 commit comments

Comments
 (0)