Skip to content

Commit e1531be

Browse files
committed
add security
1 parent 8d8ccb4 commit e1531be

3 files changed

Lines changed: 50 additions & 26 deletions

File tree

config/sets/symfony/symfony5/symfony54.php

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,7 @@
1818

1919
$rectorConfig->import(__DIR__ . '/symfony54/symfony54-validator.php');
2020
$rectorConfig->import(__DIR__ . '/symfony54/symfony54-security-bundle.php');
21-
22-
$rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [
23-
new RenameClassAndConstFetch(
24-
'Symfony\Component\Security\Core\AuthenticationEvents',
25-
'AUTHENTICATION_SUCCESS',
26-
'Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent',
27-
'class'
28-
),
29-
new RenameClassAndConstFetch(
30-
'Symfony\Component\Security\Core\AuthenticationEvents',
31-
'AUTHENTICATION_FAILURE',
32-
'Symfony\Component\Security\Core\Event\AuthenticationFailureEvent',
33-
'class'
34-
),
35-
// @see https://github.com/symfony/symfony/pull/42510
36-
new RenameClassConstFetch(
37-
'Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter',
38-
'IS_ANONYMOUS',
39-
'PUBLIC_ACCESS'
40-
),
41-
new RenameClassConstFetch(
42-
'Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter',
43-
'IS_AUTHENTICATED_ANONYMOUSLY',
44-
'PUBLIC_ACCESS'
45-
),
46-
]);
21+
$rectorConfig->import(__DIR__ . '/symfony54/symfony54-security.php');
4722

4823
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
4924
// @see https://github.com/symfony/symfony/pull/42050
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
7+
use Rector\Renaming\Rector\Name\RenameClassRector;
8+
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;
9+
use Rector\Renaming\ValueObject\RenameClassConstFetch;
10+
11+
return static function (RectorConfig $rectorConfig): void {
12+
$rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [
13+
new RenameClassAndConstFetch(
14+
'Symfony\Component\Security\Core\AuthenticationEvents',
15+
'AUTHENTICATION_SUCCESS',
16+
'Symfony\Component\Security\Core\Event\AuthenticationSuccessEvent',
17+
'class'
18+
),
19+
new RenameClassAndConstFetch(
20+
'Symfony\Component\Security\Core\AuthenticationEvents',
21+
'AUTHENTICATION_FAILURE',
22+
'Symfony\Component\Security\Core\Event\AuthenticationFailureEvent',
23+
'class'
24+
),
25+
// @see https://github.com/symfony/symfony/pull/42510
26+
new RenameClassConstFetch(
27+
'Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter',
28+
'IS_ANONYMOUS',
29+
'PUBLIC_ACCESS'
30+
),
31+
new RenameClassConstFetch(
32+
'Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter',
33+
'IS_AUTHENTICATED_ANONYMOUSLY',
34+
'PUBLIC_ACCESS'
35+
),
36+
]);
37+
38+
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
39+
// @see https://github.com/symfony/symfony/pull/42050
40+
'Symfony\Component\Security\Http\Event\DeauthenticatedEvent' => 'Symfony\Component\Security\Http\Event\TokenDeauthenticatedEvent',
41+
]);
42+
};

src/Set/SetProvider/Symfony5SetProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ public function provide(): array
270270
__DIR__ . '/../../../config/sets/symfony/symfony5/symfony54/symfony54-security-bundle.php'
271271
),
272272

273+
new ComposerTriggeredSet(
274+
SetGroup::SYMFONY,
275+
'symfony/security-bundle',
276+
'5.4',
277+
__DIR__ . '/../../../config/sets/symfony/symfony5/symfony54/symfony54-security.php'
278+
),
279+
273280
new ComposerTriggeredSet(
274281
SetGroup::SYMFONY,
275282
'symfony/*',

0 commit comments

Comments
 (0)