|
6 | 6 | use Rector\Config\RectorConfig; |
7 | 7 | use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; |
8 | 8 | use Rector\Php80\ValueObject\AnnotationToAttribute; |
9 | | -use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector; |
10 | | -use Rector\Renaming\Rector\MethodCall\RenameMethodRector; |
11 | | -use Rector\Renaming\Rector\Name\RenameClassRector; |
12 | | -use Rector\Renaming\ValueObject\MethodCallRename; |
13 | | -use Rector\Renaming\ValueObject\RenameClassAndConstFetch; |
14 | | -use Rector\Symfony\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector; |
15 | | -use Rector\Symfony\Symfony62\Rector\Class_\MessageSubscriberInterfaceToAttributeRector; |
16 | | -use Rector\Symfony\Symfony62\Rector\Class_\SecurityAttributeToIsGrantedAttributeRector; |
17 | | -use Rector\Symfony\Symfony62\Rector\ClassMethod\ClassMethod\ArgumentValueResolverToValueResolverRector; |
18 | | -use Rector\Symfony\Symfony62\Rector\ClassMethod\ParamConverterAttributeToMapEntityAttributeRector; |
19 | | -use Rector\Symfony\Symfony62\Rector\MethodCall\SimplifyFormRenderingRector; |
20 | 9 | return static function (RectorConfig $rectorConfig) : void { |
21 | | - $rectorConfig->rules([ |
22 | | - SimplifyFormRenderingRector::class, |
23 | | - SecurityAttributeToIsGrantedAttributeRector::class, |
24 | | - ParamConverterAttributeToMapEntityAttributeRector::class, |
25 | | - // @see https://github.com/symfony/symfony/pull/47068, #[AsMessageHandler] attribute |
26 | | - MessageHandlerInterfaceToAttributeRector::class, |
27 | | - MessageSubscriberInterfaceToAttributeRector::class, |
28 | | - // @see https://github.com/symfony/symfony/pull/47363 |
29 | | - ArgumentValueResolverToValueResolverRector::class, |
30 | | - ]); |
31 | 10 | // change to attribute before rename |
32 | 11 | // https://symfony.com/blog/new-in-symfony-6-2-built-in-cache-security-template-and-doctrine-attributes |
33 | 12 | // @see https://github.com/rectorphp/rector-symfony/issues/535#issuecomment-1783983383 |
|
39 | 18 | // @see https://github.com/symfony/symfony/pull/46906 |
40 | 19 | new AnnotationToAttribute('Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template'), |
41 | 20 | ]); |
42 | | - // https://symfony.com/blog/new-in-symfony-6-2-built-in-cache-security-template-and-doctrine-attributes |
43 | | - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ |
44 | | - // @see https://github.com/symfony/symfony/pull/46907 |
45 | | - 'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\IsGranted' => 'Symfony\\Component\\Security\\Http\\Attribute\\IsGranted', |
46 | | - // @see https://github.com/symfony/symfony/pull/46880 |
47 | | - 'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Cache' => 'Symfony\\Component\\HttpKernel\\Attribute\\Cache', |
48 | | - // @see https://github.com/symfony/symfony/pull/46906 |
49 | | - 'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template' => 'Symfony\\Bridge\\Twig\\Attribute\\Template', |
50 | | - // @see https://github.com/symfony/symfony/pull/46714 |
51 | | - 'Symfony\\Component\\Mailer\\Bridge\\OhMySmtp\\Transport\\OhMySmtpApiTransport' => 'Symfony\\Component\\Mailer\\Bridge\\MailPace\\Transport\\MailPaceApiTransport', |
52 | | - 'Symfony\\Component\\Mailer\\Bridge\\OhMySmtp\\Transport\\OhMySmtpSmtpTransport' => 'Symfony\\Component\\Mailer\\Bridge\\MailPace\\Transport\\MailPaceSmtpTransport', |
53 | | - 'Symfony\\Component\\Mailer\\Bridge\\OhMySmtp\\Transport\\OhMySmtpTransportFactory' => 'Symfony\\Component\\Mailer\\Bridge\\MailPace\\Transport\\MailPaceTransportFactory', |
54 | | - // @see https://github.com/symfony/symfony/pull/47363 |
55 | | - 'Symfony\\Component\\HttpKernel\\Controller\\ArgumentValueResolverInterface' => 'Symfony\\Component\\HttpKernel\\Controller\\ValueResolverInterface', |
56 | | - // @see https://github.com/symfony/symfony/pull/46094 |
57 | | - 'Symfony\\Component\\Security\\Core\\Security' => 'Symfony\\Bundle\\SecurityBundle\\Security', |
58 | | - // @see https://github.com/symfony/symfony/pull/46161 |
59 | | - 'Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor' => 'Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor', |
60 | | - // @see https://github.com/symfony/symfony/pull/47595 |
61 | | - 'Symfony\\Component\\HttpFoundation\\ExpressionRequestMatcher' => 'Symfony\\Component\\HttpFoundation\\RequestMatcher\\ExpressionRequestMatcher', |
62 | | - 'Symfony\\Component\\HttpFoundation\\RequestMatcher' => 'Symfony\\Component\\HttpFoundation\\ChainRequestMatcher', |
63 | | - ]); |
64 | | - $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ |
65 | | - // @see https://github.com/symfony/symfony/pull/46854 |
66 | | - new MethodCallRename('Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController', 'renderForm', 'render'), |
67 | | - // @see https://github.com/symfony/symfony/pull/45034 |
68 | | - new MethodCallRename('Symfony\\Component\\HttpFoundation\\Request', 'getContentType', 'getContentTypeFormat'), |
69 | | - // @see https://github.com/symfony/symfony/pull/47711 |
70 | | - new MethodCallRename('Symfony\\Component\\Mime\\Email', 'attachPart', 'addPart'), |
71 | | - ]); |
72 | | - // @see https://github.com/symfony/symfony/pull/46094 |
73 | | - // @see https://github.com/symfony/symfony/pull/48554 |
74 | | - $rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [new RenameClassAndConstFetch('Symfony\\Component\\Security\\Core\\Security', 'ACCESS_DENIED_ERROR', 'Symfony\\Component\\Security\\Http\\SecurityRequestAttributes', 'ACCESS_DENIED_ERROR'), new RenameClassAndConstFetch('Symfony\\Component\\Security\\Core\\Security', 'AUTHENTICATION_ERROR', 'Symfony\\Component\\Security\\Http\\SecurityRequestAttributes', 'AUTHENTICATION_ERROR'), new RenameClassAndConstFetch('Symfony\\Component\\Security\\Core\\Security', 'LAST_USERNAME', 'Symfony\\Component\\Security\\Http\\SecurityRequestAttributes', 'LAST_USERNAME'), new RenameClassAndConstFetch('Symfony\\Component\\Security\\Core\\Security', 'MAX_USERNAME_LENGTH', 'Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Badge\\UserBadge', 'MAX_USERNAME_LENGTH')]); |
| 21 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-security-core.php'); |
| 22 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-security-http.php'); |
| 23 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-mime.php'); |
| 24 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-http-kernel.php'); |
| 25 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-framework-bundle.php'); |
| 26 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-http-foundation.php'); |
| 27 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-twig-bridge.php'); |
| 28 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-translation.php'); |
| 29 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-doctrine-bridge.php'); |
| 30 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-messenger.php'); |
| 31 | + $rectorConfig->import(__DIR__ . '/symfony62/symfony62-mail-pace-mailer.php'); |
75 | 32 | }; |
0 commit comments