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
13 changes: 13 additions & 0 deletions config/sets/symfony/symfony7/symfony70.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

// @see https://github.com/symfony/symfony/blob/7.0/UPGRADE-7.0.md
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/symfony70/symfony70-dependency-injection.php');
$rectorConfig->import(__DIR__ . '/symfony70/symfony70-serializer.php');
$rectorConfig->import(__DIR__ . '/symfony70/symfony70-http-foundation.php');
$rectorConfig->import(__DIR__ . '/symfony70/symfony70-contracts.php');
};
14 changes: 14 additions & 0 deletions config/sets/symfony/symfony7/symfony70/symfony70-contracts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;

return static function (RectorConfig $rectorConfig): void {
// the "@required" was dropped, use attribute instead
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
new AnnotationToAttribute('required', 'Symfony\Contracts\Service\Attribute\Required'),
]);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Class_\RenameAttributeRector;
use Rector\Renaming\ValueObject\RenameAttribute;

return static function (RectorConfig $rectorConfig): void {
// @see https://github.com/symfony/symfony/blob/7.0/UPGRADE-7.0.md#dependencyinjection
$rectorConfig->ruleWithConfiguration(RenameAttributeRector::class, [
new RenameAttribute(
'Symfony\Component\DependencyInjection\Attribute\MapDecorated',
'Symfony\Component\DependencyInjection\Attribute\AutowireDecorated',
),
]);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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(RenameClassRector::class, [
// @see https://github.com/symfony/symfony/blob/7.0/UPGRADE-7.0.md#httpfoundation
'Symfony\Component\HttpFoundation\RequestMatcher' => 'Symfony\Component\HttpFoundation\ChainRequestMatcher',
'Symfony\Component\HttpFoundation\ExpressionRequestMatcher' => 'Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher',
]);

// @see https://github.com/symfony/symfony/pull/50826
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename('Symfony\Component\HttpFoundation\Request', 'getContentType', 'getContentTypeFormat'),
]);
};
14 changes: 14 additions & 0 deletions config/sets/symfony/symfony7/symfony70/symfony70-serializer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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, [
// @see https://github.com/symfony/symfony/blob/7.0/UPGRADE-7.0.md#frameworkbundle
'Symfony\Component\Serializer\Normalizer\ObjectNormalizer' => 'Symfony\Component\Serializer\Normalizer\NormalizerInterface',
'Symfony\Component\Serializer\Normalizer\PropertyNormalizer' => 'Symfony\Component\Serializer\Normalizer\NormalizerInterface',
]);
};
43 changes: 0 additions & 43 deletions config/sets/symfony/symfony70.php

This file was deleted.

29 changes: 27 additions & 2 deletions src/Set/SetProvider/Symfony7SetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,35 @@ public function provide(): array
return [
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
'symfony/symfony',
'7.0',
__DIR__ . '/../../../config/sets/symfony/symfony7/symfony70.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/dependency-injection',
'7.0',
__DIR__ . '/../../../config/sets/symfony/symfony7/symfony70/symfony70-dependency-injection.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/serializer',
'7.0',
__DIR__ . '/../../../config/sets/symfony/symfony70.php'
__DIR__ . '/../../../config/sets/symfony/symfony7/symfony70/symfony70-serializer.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/http-foundation',
'7.0',
__DIR__ . '/../../../config/sets/symfony/symfony7/symfony70/symfony70-http-foundation.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/contracts',
'7.0',
__DIR__ . '/../../../config/sets/symfony/symfony7/symfony70/symfony70-contracts.php'
),

new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/*',
Expand Down
2 changes: 1 addition & 1 deletion src/Set/SymfonySetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ final class SymfonySetList
/**
* @var string
*/
final public const SYMFONY_70 = __DIR__ . '/../../config/sets/symfony/symfony70.php';
final public const SYMFONY_70 = __DIR__ . '/../../config/sets/symfony/symfony7/symfony70.php';

/**
* @var string
Expand Down
Loading