Skip to content

Commit 9cc7ebd

Browse files
authored
[symfony 4.1] split to particular configs (#730)
* move * [symfony 4.1] split to particular configs
1 parent e3f9449 commit 9cc7ebd

File tree

10 files changed

+100
-22
lines changed

10 files changed

+100
-22
lines changed
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+
7+
# https://github.com/symfony/symfony/blob/master/UPGRADE-4.1.md
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-console.php');
10+
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-http-foundation.php');
11+
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-workflow.php');
12+
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-framework-bundle.php');
13+
14+
};

config/sets/symfony/symfony41.php renamed to config/sets/symfony/symfony4/symfony41/symfony41-console.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
7-
use Rector\Renaming\Rector\Name\RenameClassRector;
87
use Rector\Renaming\ValueObject\MethodCallRename;
98
use Rector\Renaming\ValueObject\MethodCallRenameWithArrayKey;
109

11-
# https://github.com/symfony/symfony/blob/master/UPGRADE-4.1.md
1210
return static function (RectorConfig $rectorConfig): void {
1311
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
1412
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
@@ -29,9 +27,7 @@
2927
'setCrossingChar',
3028
'setDefaultCrossingChar'
3129
),
32-
new MethodCallRename('Symfony\Component\HttpFoundation\File\UploadedFile', 'getClientSize', 'getSize'),
33-
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'reset', 'clear'),
34-
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'add', 'addWorkflow'),
30+
3531
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
3632
new MethodCallRenameWithArrayKey(
3733
'Symfony\Component\Console\Helper\TableStyle',
@@ -48,11 +44,4 @@
4844
2
4945
),
5046
]);
51-
52-
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
53-
# https://github.com/symfony/symfony/commit/07dd09db59e2f2a86a291d00d978169d9059e307
54-
'Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector' => 'Symfony\Component\HttpKernel\DataCollector\RequestDataCollector',
55-
'Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface' => 'Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface',
56-
'Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy' => 'Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy',
57-
]);
5847
};
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+
use Rector\Renaming\Rector\Name\RenameClassRector;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
10+
# https://github.com/symfony/symfony/commit/07dd09db59e2f2a86a291d00d978169d9059e307
11+
'Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector' => 'Symfony\Component\HttpKernel\DataCollector\RequestDataCollector',
12+
]);
13+
};
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+
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
7+
use Rector\Renaming\ValueObject\MethodCallRename;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
11+
new MethodCallRename('Symfony\Component\HttpFoundation\File\UploadedFile', 'getClientSize', 'getSize'),
12+
]);
13+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
7+
use Rector\Renaming\Rector\Name\RenameClassRector;
8+
use Rector\Renaming\ValueObject\MethodCallRename;
9+
10+
return static function (RectorConfig $rectorConfig): void {
11+
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
12+
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'reset', 'clear'),
13+
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'add', 'addWorkflow'),
14+
]);
15+
16+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
17+
'Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface' => 'Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface',
18+
'Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy' => 'Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy',
19+
]);
20+
};
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/Set/SetProvider/SymfonySetProvider.php

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,31 +204,60 @@ public function provide(): array
204204
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-forms.php'
205205
),
206206

207-
// @todo split rest
207+
new ComposerTriggeredSet(
208+
SetGroup::SYMFONY,
209+
'symfony/symfony',
210+
'4.1',
211+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41.php'
212+
),
208213

209214
new ComposerTriggeredSet(
210215
SetGroup::SYMFONY,
211-
'symfony/*',
216+
'symfony/console',
212217
'4.1',
213-
__DIR__ . '/../../../config/sets/symfony/symfony41.php'
218+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-console.php'
214219
),
220+
221+
new ComposerTriggeredSet(
222+
SetGroup::SYMFONY,
223+
'symfony/framework-bundle',
224+
'4.1',
225+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-framework-bundle.php'
226+
),
227+
228+
new ComposerTriggeredSet(
229+
SetGroup::SYMFONY,
230+
'symfony/http-foundation',
231+
'4.1',
232+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-http-foundation.php'
233+
),
234+
235+
new ComposerTriggeredSet(
236+
SetGroup::SYMFONY,
237+
'symfony/workflow',
238+
'4.1',
239+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-workflow.php'
240+
),
241+
242+
// @todo split rest
243+
215244
new ComposerTriggeredSet(
216245
SetGroup::SYMFONY,
217246
'symfony/*',
218247
'4.2',
219-
__DIR__ . '/../../../config/sets/symfony/symfony42.php'
248+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony42.php'
220249
),
221250
new ComposerTriggeredSet(
222251
SetGroup::SYMFONY,
223252
'symfony/*',
224253
'4.3',
225-
__DIR__ . '/../../../config/sets/symfony/symfony43.php'
254+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony43.php'
226255
),
227256
new ComposerTriggeredSet(
228257
SetGroup::SYMFONY,
229258
'symfony/*',
230259
'4.4',
231-
__DIR__ . '/../../../config/sets/symfony/symfony44.php'
260+
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony44.php'
232261
),
233262
new ComposerTriggeredSet(
234263
SetGroup::SYMFONY,

src/Set/SymfonySetList.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ final class SymfonySetList
6969
/**
7070
* @var string
7171
*/
72-
final public const SYMFONY_41 = __DIR__ . '/../../config/sets/symfony/symfony41.php';
72+
final public const SYMFONY_41 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony41.php';
7373

7474
/**
7575
* @var string
7676
*/
77-
final public const SYMFONY_42 = __DIR__ . '/../../config/sets/symfony/symfony42.php';
77+
final public const SYMFONY_42 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony42.php';
7878

7979
/**
8080
* @var string
8181
*/
82-
final public const SYMFONY_43 = __DIR__ . '/../../config/sets/symfony/symfony43.php';
82+
final public const SYMFONY_43 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony43.php';
8383

8484
/**
8585
* @var string
8686
*/
87-
final public const SYMFONY_44 = __DIR__ . '/../../config/sets/symfony/symfony44.php';
87+
final public const SYMFONY_44 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony44.php';
8888

8989
/**
9090
* @var string

0 commit comments

Comments
 (0)