Skip to content

Commit c3dfdd2

Browse files
committed
feature #46094 [Security][SecurityBundle] Move the Security helper to SecurityBundle (chalasr)
This PR was merged into the 6.2 branch. Discussion ---------- [Security][SecurityBundle] Move the `Security` helper to SecurityBundle | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | Fixes symfony/symfony#46066 (comment) | License | MIT | Doc PR | todo The `Security` helper is a high-level service providing an easy access to commonly-needed features coming from various low-level abstractions. Basically, it's a facade. Based on this, it makes sense to me to make it available only via the full-stack framework, as proposed by Wouter in symfony/symfony#46066 (comment). This unlocks #46066, symfony/symfony#41274 and symfony/symfony#41406. /cc @wouterj @johnkrovitch @Kocal Commits ------- 7b91bcb068 [Security] Move the `Security` helper to SecurityBundle
2 parents b135f22 + cdee332 commit c3dfdd2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@
186186
use Symfony\Component\RateLimiter\Storage\CacheStorage;
187187
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
188188
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
189+
use Symfony\Component\Security\Core\AuthenticationEvents;
189190
use Symfony\Component\Security\Core\Exception\AuthenticationException;
190-
use Symfony\Component\Security\Core\Security;
191191
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
192192
use Symfony\Component\Semaphore\PersistingStoreInterface as SemaphoreStoreInterface;
193193
use Symfony\Component\Semaphore\Semaphore;
@@ -1020,7 +1020,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
10201020
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
10211021
}
10221022

1023-
if (!class_exists(Security::class)) {
1023+
if (!class_exists(AuthenticationEvents::class)) {
10241024
throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security-core".');
10251025
}
10261026

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
use Symfony\Component\HttpKernel\Fragment\FragmentUriGeneratorInterface;
5858
use Symfony\Component\Messenger\Transport\TransportFactory;
5959
use Symfony\Component\PropertyAccess\PropertyAccessor;
60-
use Symfony\Component\Security\Core\Security;
60+
use Symfony\Component\Security\Core\AuthenticationEvents;
6161
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
6262
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
6363
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
@@ -1036,7 +1036,7 @@ public function testTranslator()
10361036
$files,
10371037
'->registerTranslatorConfiguration() finds Form translation resources'
10381038
);
1039-
$ref = new \ReflectionClass(Security::class);
1039+
$ref = new \ReflectionClass(AuthenticationEvents::class);
10401040
$this->assertContains(
10411041
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', \DIRECTORY_SEPARATOR),
10421042
$files,

0 commit comments

Comments
 (0)