8000 [Security] Move configuration of collectors to PHP · symfony/symfony@2176ed2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2176ed2

Browse files
JudicaelJudicael RUFFIEUX
Judicael
authored and
Judicael RUFFIEUX
committed
[Security] Move configuration of collectors to PHP
1 parent 6b499e6 commit 2176ed2

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function load(array $configs, ContainerBuilder $container)
135135
$phpLoader->load('templating_twig.php');
136136
}
137137

138-
$loader->load('collectors.xml');
138+
$phpLoader->load('collectors.php');
139139
$loader->load('guard.xml');
140140

141141
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13+
14+
use Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector;
15+
16+
return static function (ContainerConfigurator $container) {
17+
$container->services()
18+
->set('data_collector.security', SecurityDataCollector::class)
19+
->args([
20+
service('security.untracked_token_storage'),
21+
service('security.role_hierarchy'),
22+
service('security.logout_url_generator'),
23+
service('security.access.decision_manager'),
24+
service('security.firewall.map'),
25+
service('debug.security.firewall')->nullOnInvalid(),
26+
])
27+
->tag('data_collector', [
28+
'template' => '@Security/Collector/security.html.twig',
29+
'id' => 'security',
30+
'priority' => 270,
31+
])
32+
;
33+
};

src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0