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
30 changes: 30 additions & 0 deletions config/sets/symfony/symfony50.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,46 @@

declare(strict_types=1);

use PHPStan\Type\StringType;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
use Rector\TypeDeclaration\ValueObject\AddParamTypeDeclaration;

# https://github.com/symfony/symfony/blob/5.0/UPGRADE-5.0.md

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/symfony50-types.php');

$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [
new AddParamTypeDeclaration(
'Symfony\Component\Security\Core\User\UserProviderInterface',
'loadUserByUsername',
0,
new StringType(),
),
new AddParamTypeDeclaration(
'Symfony\Component\Security\Core\User\UserProviderInterface',
'supportsClass',
0,
new StringType(),
),
new AddParamTypeDeclaration(
'Symfony\Bridge\Doctrine\Security\User\EntityUserProvider',
'loadUserByUsername',
0,
new StringType(),
),
new AddParamTypeDeclaration(
'Symfony\Bridge\Doctrine\Security\User\EntityUserProvider',
'supportsClass',
0,
new StringType(),
),
]);

$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
'Symfony\Component\Debug\Debug' => 'Symfony\Component\ErrorHandler\Debug',
]);
Expand Down
14 changes: 13 additions & 1 deletion config/sets/symfony/symfony60.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PhpParser\Node\Scalar\String_;
use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\StringType;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
Expand Down Expand Up @@ -36,7 +37,18 @@
]);

$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [
new AddParamTypeDeclaration('Symfony\Component\Config\Loader\LoaderInterface', 'load', 0, new MixedType(true)),
new AddParamTypeDeclaration(
'Symfony\Component\Config\Loader\LoaderInterface',
'load',
0,
new MixedType(true)
),
new AddParamTypeDeclaration(
'Symfony\Component\Config\Loader\LoaderInterface',
'supports',
0,
new MixedType(true)
),
new AddParamTypeDeclaration(
'Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait',
'configureRoutes',
Expand Down
Loading