Lazy load security listeners
This commit is contained in:
parent
1195c7d97e
commit
e3ee6bc349
@ -32,6 +32,11 @@ Process
|
||||
* The `Symfony\Component\Process\ProcessBuilder` class has been deprecated,
|
||||
use the `Symfony\Component\Process\Process` class directly instead.
|
||||
|
||||
SecurityBundle
|
||||
--------------
|
||||
|
||||
* `FirewallContext::getListeners()` now returns `\Traversable|array`
|
||||
|
||||
Validator
|
||||
---------
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* [BC BREAK] `FirewallContext::getListeners()` now returns `\Traversable|array`
|
||||
|
||||
3.3.0
|
||||
-----
|
||||
|
||||
|
@ -265,7 +265,7 @@ class SecurityExtension extends Extension
|
||||
$contextId = 'security.firewall.map.context.'.$name;
|
||||
$context = $container->setDefinition($contextId, new ChildDefinition('security.firewall.context'));
|
||||
$context
|
||||
->replaceArgument(0, $listeners)
|
||||
->replaceArgument(0, new IteratorArgument($listeners))
|
||||
->replaceArgument(1, $exceptionListener)
|
||||
->replaceArgument(2, new Reference($configId))
|
||||
;
|
||||
|
@ -25,7 +25,12 @@ class FirewallContext
|
||||
private $exceptionListener;
|
||||
private $config;
|
||||
|
||||
public function __construct(array $listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
|
||||
/**
|
||||
* @param \Traversable|array $listeners
|
||||
* @param ExceptionListener|null $exceptionListener
|
||||
* @param FirewallConfig|null $firewallConfig
|
||||
*/
|
||||
public function __construct($listeners, ExceptionListener $exceptionListener = null, FirewallConfig $config = null)
|
||||
{
|
||||
$this->listeners = $listeners;
|
||||
$this->exceptionListener = $exceptionListener;
|
||||
@ -47,6 +52,9 @@ class FirewallContext
|
||||
return array($this->getListeners(), $this->getExceptionListener());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Traversable|array
|
||||
*/
|
||||
public function getListeners()
|
||||
{
|
||||
return $this->listeners;
|
||||
|
@ -72,7 +72,7 @@ abstract class CompleteConfigurationTest extends TestCase
|
||||
foreach (array_keys($arguments[1]->getValues()) as $contextId) {
|
||||
$contextDef = $container->getDefinition($contextId);
|
||||
$arguments = $contextDef->getArguments();
|
||||
$listeners[] = array_map('strval', $arguments['index_0']);
|
||||
$listeners[] = array_map('strval', $arguments['index_0']->getValues());
|
||||
|
||||
$configDef = $container->getDefinition((string) $arguments['index_2']);
|
||||
$configs[] = array_values($configDef->getArguments());
|
||||
|
Reference in New Issue
Block a user