10000 Lazy load security listeners · symfony/symfony@1ec82ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ec82ed

Browse files
committed
Lazy load security listeners
1 parent 1195c7d commit 1ec82ed

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

UPGRADE-3.4.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ UPGRADE FROM 3.3 to 3.4
44
DependencyInjection
55
-------------------
66

7-
* Top-level anonymous services in XML are deprecated and will throw an exception in Symfony 4.0.
7+
* Top-level anonymous services in XML are deprecated and will throw an exception in Symfony 4.0.
88

99
Finder
1010
------
@@ -32,6 +32,11 @@ Process
3232
* The `Symfony\Component\Process\ProcessBuilder` class has been deprecated,
3333
use the `Symfony\Component\Process\Process` class directly instead.
3434

35+
SecurityBundle
36+
--------------
37+
38+
* `FirewallContext::getListeners()` now returns `\Traversable|array`
39+
3540
Validator
3641
---------
3742

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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class FirewallContext
2525
private $exceptionListener;
2626
private $config;
2727

28-
public function __construct(array $listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
28+
/**
29+
* @param \Traversable|array $listeners
30+
*/
31+
public function __construct($listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
2932
{
3033
$this->listeners = $listeners;
3134
$this->exceptionListener = $exceptionListener;
@@ -47,6 +50,9 @@ public function getContext()
4750
return array($this->getListeners(), $this->getExceptionListener());
4851
}
4952

53+
/**
54+
* @return \Traversable|array
55+
*/
5056
public function getListeners()
5157
{
5258
return $this->listeners;

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)
0