Skip to content

Commit 09d71e4

Browse files
committed
Lazy load security listeners
1 parent e4e1b81 commit 09d71e4

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

UPGRADE-3.4.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ FrameworkBundle
2626
* The `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()`
2727
methods are deprecated since 3.4 and will be removed in 4.0.
2828

29+
SecurityBundle
30+
--------------
31+
32+
* `FirewallContext::getListeners()` now returns `\Traversable|array`
33+
2934
Validator
3035
---------
3136

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
3.4.0
5+
-----
6+
7+
* [BC BREAK] `FirewallContext::getListeners()` now returns `\Traversable|array`
8+
49
3.3.0
510
-----
611

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private function createFirewalls($config, ContainerBuilder $container)
265265
$contextId = 'security.firewall.map.context.'.$name;
266266
$context = $container->setDefinition($contextId, new ChildDefinition('security.firewall.context'));
267267
$context
268-
->replaceArgument(0, $listeners)
268+
->replaceArgument(0, new IteratorArgument($listeners))
269269
->replaceArgument(1, $exceptionListener)
270270
->replaceArgument(2, new Reference($configId))
271271
;

src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FirewallContext
2525
private $exceptionListener;
2626
private $config;
2727

28-
public function __construct(array $listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
28+
public function __construct(/* iterable */ $listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
2929
{
3030
$this->listeners = $listeners;
3131
$this->exceptionListener = $exceptionListener;
@@ -47,7 +47,7 @@ public function getContext()
4747
return array($this->getListeners(), $this->getExceptionListener());
4848
}
4949

50-
public function getListeners()
50+
public function getListeners()/*: iterable */
5151
{
5252
return $this->listeners;
5353
}

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testFirewalls()
7272
foreach (array_keys($arguments[1]->getValues()) as $contextId) {
7373
$contextDef = $container->getDefinition($contextId);
7474
$arguments = $contextDef->getArguments();
75-
$listeners[] = array_map('strval', $arguments['index_0']);
75+
$listeners[] = array_map('strval', $arguments['index_0']->getValues());
7676

7777
$configDef = $container->getDefinition((string) $arguments['index_2']);
7878
$configs[] = array_values($configDef->getArguments());

0 commit comments

Comments
 (0)