Skip to content

Commit e3f9449

Browse files
authored
[symfony 4.0] split of particular configs, improve SetListProvider (#729)
1 parent bdbdc16 commit e3f9449

9 files changed

Lines changed: 115 additions & 32 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return static function (RectorConfig $rectorConfig): void {
8+
$rectorConfig->import(__DIR__ . '/symfony40/symfony40-validator.php');
9+
$rectorConfig->import(__DIR__ . '/symfony40/symfony40-dependency-injection.php');
10+
$rectorConfig->import(__DIR__ . '/symfony40/symfony40-process.php');
11+
$rectorConfig->import(__DIR__ . '/symfony40/symfony40-forms.php');
12+
$rectorConfig->import(__DIR__ . '/symfony40/symfony40-var-dumper.php');
13+
};
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\Symfony40\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->rules([ContainerBuilderCompileEnvArgumentRector::class]);
10+
};
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\Symfony40\Rector\MethodCall\FormIsValidRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->rules([FormIsValidRector::class]);
10+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
'Symfony\Component\Process\ProcessBuilder' => 'Symfony\Component\Process\Process',
11+
]);
12+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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\Symfony40\Rector\ConstFetch\ConstraintUrlOptionRector;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->rules([ConstraintUrlOptionRector::class]);
11+
12+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
13+
'Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest' => 'Symfony\Component\Validator\Test\ConstraintValidatorTestCase',
14+
]);
15+
};
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\Symfony40\Rector\MethodCall\VarDumperTestTraitMethodArgsRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->rules([VarDumperTestTraitMethodArgsRector::class]);
10+
};

config/sets/symfony/symfony40.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Set/SetProvider/SymfonySetProvider.php

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,32 +143,69 @@ public function provide(): array
143143
__DIR__ . '/../../../config/sets/symfony/symfony3/symfony31/symfony31-yaml.php'
144144
),
145145

146-
// @todo split rest
147-
148146
new ComposerTriggeredSet(
149147
SetGroup::SYMFONY,
150-
'symfony/*',
148+
'symfony/symfony',
151149
'3.2',
152150
__DIR__ . '/../../../config/sets/symfony/symfony3/symfony32.php'
153151
),
154152
new ComposerTriggeredSet(
155153
SetGroup::SYMFONY,
156-
'symfony/*',
154+
'symfony/symfony',
157155
'3.3',
158156
__DIR__ . '/../../../config/sets/symfony/symfony3/symfony33.php'
159157
),
160158
new ComposerTriggeredSet(
161159
SetGroup::SYMFONY,
162-
'symfony/*',
160+
'symfony/symfony',
163161
'3.4',
164162
__DIR__ . '/../../../config/sets/symfony/symfony3/symfony34.php'
165163
),
164+
166165
new ComposerTriggeredSet(
167166
SetGroup::SYMFONY,
168-
'symfony/*',
167+
'symfony/symfony',
168+
'4.0',
169+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40.php'
170+
),
171+
172+
new ComposerTriggeredSet(
173+
SetGroup::SYMFONY,
174+
'symfony/dependency-injection',
175+
'4.0',
176+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-dependency-injection.php'
177+
),
178+
179+
new ComposerTriggeredSet(
180+
SetGroup::SYMFONY,
181+
'symfony/process',
169182
'4.0',
170-
__DIR__ . '/../../../config/sets/symfony/symfony40.php'
183+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-process.php'
171184
),
185+
186+
new ComposerTriggeredSet(
187+
SetGroup::SYMFONY,
188+
'symfony/validator',
189+
'4.0',
190+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-validator.php'
191+
),
192+
193+
new ComposerTriggeredSet(
194+
SetGroup::SYMFONY,
195+
'symfony/var-dumper',
196+
'4.0',
197+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-var-dumper.php'
198+
),
199+
200+
new ComposerTriggeredSet(
201+
SetGroup::SYMFONY,
202+
'symfony/forms',
203+
'4.0',
204+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-forms.php'
205+
),
206+
207+
// @todo split rest
208+
172209
new ComposerTriggeredSet(
173210
SetGroup::SYMFONY,
174211
'symfony/*',

src/Set/SymfonySetList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class SymfonySetList
6464
/**
6565
* @var string
6666
*/
67-
final public const SYMFONY_40 = __DIR__ . '/../../config/sets/symfony/symfony40.php';
67+
final public const SYMFONY_40 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony40.php';
6868

6969
/**
7070
* @var string

0 commit comments

Comments
 (0)