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
2 changes: 1 addition & 1 deletion config/sets/symfony/symfony6/symfony62.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
new AnnotationToAttribute('Sensio\Bundle\FrameworkExtraBundle\Configuration\Template'),
]);

$rectorConfig->import(__DIR__ . '/symfony62/symfony62-security-core.php');
$rectorConfig->import(__DIR__ . '/symfony62/symfony62-security-bundle.php');
$rectorConfig->import(__DIR__ . '/symfony62/symfony62-security-http.php');
$rectorConfig->import(__DIR__ . '/symfony62/symfony62-mime.php');
$rectorConfig->import(__DIR__ . '/symfony62/symfony62-http-kernel.php');
Expand Down
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\Name\RenameClassRector;

return static function (RectorConfig $rectorConfig): void {
// https://symfony.com/blog/new-in-symfony-6-2-built-in-cache-security-template-and-doctrine-attributes
$rectorConfig->ruleWithConfiguration(
RenameClassRector::class,
[
// @see https://github.com/symfony/symfony/pull/46094
'Symfony\Component\Security\Core\Security' => 'Symfony\Bundle\SecurityBundle\Security',
],
);
};
48 changes: 0 additions & 48 deletions config/sets/symfony/symfony6/symfony62/symfony62-security-core.php

This file was deleted.

31 changes: 31 additions & 0 deletions config/sets/symfony/symfony6/symfony62/symfony62-security-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Symfony\Symfony62\Rector\Class_\SecurityAttributeToIsGrantedAttributeRector;
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(SecurityAttributeToIsGrantedAttributeRector::class);
Expand All @@ -16,4 +18,33 @@
'Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted' => 'Symfony\Component\Security\Http\Attribute\IsGranted',
],
);

// @see https://github.com/symfony/symfony/pull/46094
// @see https://github.com/symfony/symfony/pull/48554
$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'
),
]);
};

This file was deleted.

4 changes: 2 additions & 2 deletions src/Set/SetProvider/Symfony6SetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ public function provide(): array
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
'symfony/security-core',
'symfony/security-bundle',
'6.2',
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony62/symfony62-security-core.php'
__DIR__ . '/../../../config/sets/symfony/symfony6/symfony62/symfony62-security-bundle.php'
),
new ComposerTriggeredSet(
SetGroup::SYMFONY,
Expand Down