Skip to content

Commit

Permalink
improve Symfony 7.0 and 7.1 sets
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 23, 2024
1 parent 79e32b8 commit c8e1324
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/sets/symfony/symfony70.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// @see https://github.com/symfony/symfony/pull/50826
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
new MethodCallRename('Symfony\Component\HttpFoundation\Request', 'getContentType', 'getContentTypeFormat')
new MethodCallRename('Symfony\Component\HttpFoundation\Request', 'getContentType', 'getContentTypeFormat'),
]);

// the "@required" was dropped, use attribute instead
Expand Down
16 changes: 13 additions & 3 deletions config/sets/symfony/symfony71.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Class_\RenameAttributeRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Renaming\ValueObject\RenameAttribute;

// @see https://github.com/symfony/symfony/blob/7.1/UPGRADE-7.1.md
return static function (RectorConfig $rectorConfig): void {

return RectorConfig::configure()
// @see https://github.com/symfony/symfony/blob/7.1/UPGRADE-7.1.md#dependencyinjection
$rectorConfig->ruleWithConfiguration(RenameAttributeRector::class, [
->withConfiguredRule(RenameAttributeRector::class, [
new RenameAttribute(
'Symfony\Component\DependencyInjection\Attribute\TaggedIterator',
'Symfony\Component\DependencyInjection\Attribute\AutowireIterator'
Expand All @@ -18,5 +21,12 @@
'Symfony\Component\DependencyInjection\Attribute\TaggedLocator',
'Symfony\Component\DependencyInjection\Attribute\AutowireLocator'
),
])
->withConfiguredRule(RenameMethodRector::class, [
// typo fix
new MethodCallRename(
'̈́Symfony\Component\Serializer\Context\Normalizer\AbstractNormalizerContextBuilder',
'withDefaultContructorArguments',
'withDefaultConstructorArguments',
),
]);
};

0 comments on commit c8e1324

Please sign in to comment.