Skip to content
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
14 changes: 14 additions & 0 deletions config/sets/symfony/symfony4/symfony41.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

# https://github.com/symfony/symfony/blob/master/UPGRADE-4.1.md
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-console.php');
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-http-foundation.php');
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-workflow.php');
$rectorConfig->import(__DIR__ . '/symfony41/symfony41-framework-bundle.php');

};
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Renaming\ValueObject\MethodCallRenameWithArrayKey;

# https://github.com/symfony/symfony/blob/master/UPGRADE-4.1.md
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
Expand All @@ -29,9 +27,7 @@
'setCrossingChar',
'setDefaultCrossingChar'
),
new MethodCallRename('Symfony\Component\HttpFoundation\File\UploadedFile', 'getClientSize', 'getSize'),
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'reset', 'clear'),
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'add', 'addWorkflow'),

# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRenameWithArrayKey(
'Symfony\Component\Console\Helper\TableStyle',
Expand All @@ -48,11 +44,4 @@
2
),
]);

$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
# https://github.com/symfony/symfony/commit/07dd09db59e2f2a86a291d00d978169d9059e307
'Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector' => 'Symfony\Component\HttpKernel\DataCollector\RequestDataCollector',
'Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface' => 'Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface',
'Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy' => 'Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy',
]);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Name\RenameClassRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
# https://github.com/symfony/symfony/commit/07dd09db59e2f2a86a291d00d978169d9059e307
'Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector' => 'Symfony\Component\HttpKernel\DataCollector\RequestDataCollector',
]);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename('Symfony\Component\HttpFoundation\File\UploadedFile', 'getClientSize', 'getSize'),
]);
};
20 changes: 20 additions & 0 deletions config/sets/symfony/symfony4/symfony41/symfony41-workflow.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'reset', 'clear'),
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'add', 'addWorkflow'),
]);

$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
'Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface' => 'Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface',
'Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy' => 'Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy',
]);
};
41 changes: 35 additions & 6 deletions src/Set/SetProvider/SymfonySetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,31 +204,60 @@ public function provide(): array
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony40/symfony40-forms.php'
),

// @todo split rest
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/symfony',
'4.1',
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41.php'
),

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
'symfony/console',
'4.1',
__DIR__ . '/../../../config/sets/symfony/symfony41.php'
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-console.php'
),

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/framework-bundle',
'4.1',
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-framework-bundle.php'
),

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/http-foundation',
'4.1',
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-http-foundation.php'
),

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/workflow',
'4.1',
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony41/symfony41-workflow.php'
),

// @todo split rest

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
'4.2',
__DIR__ . '/../../../config/sets/symfony/symfony42.php'
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony42.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
'4.3',
__DIR__ . '/../../../config/sets/symfony/symfony43.php'
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony43.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
'4.4',
__DIR__ . '/../../../config/sets/symfony/symfony44.php'
__DIR__ . '/../../../config/sets/symfony/symfony4/symfony44.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
Expand Down
8 changes: 4 additions & 4 deletions src/Set/SymfonySetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@ final class SymfonySetList
/**
* @var string
*/
final public const SYMFONY_41 = __DIR__ . '/../../config/sets/symfony/symfony41.php';
final public const SYMFONY_41 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony41.php';

/**
* @var string
*/
final public const SYMFONY_42 = __DIR__ . '/../../config/sets/symfony/symfony42.php';
final public const SYMFONY_42 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony42.php';

/**
* @var string
*/
final public const SYMFONY_43 = __DIR__ . '/../../config/sets/symfony/symfony43.php';
final public const SYMFONY_43 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony43.php';

/**
* @var string
*/
final public const SYMFONY_44 = __DIR__ . '/../../config/sets/symfony/symfony44.php';
final public const SYMFONY_44 = __DIR__ . '/../../config/sets/symfony/symfony4/symfony44.php';

/**
* @var string
Expand Down
Loading