Skip to content

Commit f1739a3

Browse files
committed
Use short array deconstruction syntax.
1 parent fedaba9 commit f1739a3

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private function createFirewalls(array $config, ContainerBuilder $container)
239239

240240
$configId = 'security.firewall.map.config.'.$name;
241241

242-
list($matcher, $listeners, $exceptionListener, $logoutListener) = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId);
242+
[$matcher, $listeners, $exceptionListener, $logoutListener] = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId);
243243

244244
$contextId = 'security.firewall.map.context.'.$name;
245245
$context = new ChildDefinition($firewall['stateless'] || empty($firewall['anonymous']['lazy']) ? 'security.firewall.context' : 'security.firewall.lazy_context');
@@ -397,7 +397,7 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
397397
$configuredEntryPoint = isset($firewall['entry_point']) ? $firewall['entry_point'] : null;
398398

399399
// Authentication listeners
400-
list($authListeners, $defaultEntryPoint) = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId);
400+
[$authListeners, $defaultEntryPoint] = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId);
401401

402402
$config->replaceArgument(7, $configuredEntryPoint ?: $defaultEntryPoint);
403403

@@ -479,7 +479,7 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
479479
throw new InvalidConfigurationException(sprintf('Not configuring explicitly the provider for the "%s" listener on "%s" firewall is ambiguous as there is more than one registered provider.', $key, $id));
480480
}
481481

482-
list($provider, $listenerId, $defaultEntryPoint) = $factory->create($container, $id, $firewall[$key], $userProvider, $defaultEntryPoint);
482+
[$provider, $listenerId, $defaultEntryPoint] = $factory->create($container, $id, $firewall[$key], $userProvider, $defaultEntryPoint);
483483

484484
$listeners[] = new Reference($listenerId);
485485
$authenticationProviders[] = $provider;

Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function testAccess()
236236
}
237237

238238
$matcherIds = [];
239-
foreach ($rules as list($matcherId, $attributes, $channel)) {
239+
foreach ($rules as [$matcherId, $attributes, $channel]) {
240240
$requestMatcher = $container->getDefinition($matcherId);
241241

242242
$this->assertArrayNotHasKey($matcherId, $matcherIds);

Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AbstractFactoryTest extends TestCase
1919
{
2020
public function testCreate()
2121
{
22-
list($container, $authProviderId, $listenerId, $entryPointId) = $this->callFactory('foo', [
22+
[$container, $authProviderId, $listenerId, $entryPointId] = $this->callFactory('foo', [
2323
'use_forward' => true,
2424
'failure_path' => '/foo',
2525
'success_handler' => 'custom_success_handler',
@@ -61,7 +61,7 @@ public function testDefaultFailureHandler($serviceId, $defaultHandlerInjection)
6161
$options['failure_handler'] = $serviceId;
6262
}
6363

64-
list($container) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
64+
[$container] = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
6565

6666
$definition = $container->getDefinition('abstract_listener.foo');
6767
$arguments = $definition->getArguments();
@@ -99,7 +99,7 @@ public function testDefaultSuccessHandler($serviceId, $defaultHandlerInjection)
9999
$options['success_handler'] = $serviceId;
100100
}
101101

102-
list($container) = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
102+
[$container] = $this->callFactory('foo', $options, 'user_provider', 'entry_point');
103103

104104
$definition = $container->getDefinition('abstract_listener.foo');
105105
$arguments = $definition->getArguments();
@@ -150,7 +150,7 @@ protected function callFactory($id, $config, $userProviderId, $defaultEntryPoint
150150
$container->register('custom_success_handler');
151151
$container->register('custom_failure_handler');
152152

153-
list($authProviderId, $listenerId, $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
153+
[$authProviderId, $listenerId, $entryPointId] = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
154154

155155
return [$container, $authProviderId, $listenerId, $entryPointId];
156156
}

Tests/DependencyInjection/Security/Factory/GuardAuthenticationFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testBasicCreate()
103103
'authenticators' => ['authenticator123'],
104104
'entry_point' => null,
105105
];
106-
list($container, $entryPointId) = $this->executeCreate($config, null);
106+
[$container, $entryPointId] = $this->executeCreate($config, null);
107107
$this->assertEquals('authenticator123', $entryPointId);
108108

109109
$providerDefinition = $container->getDefinition('security.authentication.provider.guard.my_firewall');
@@ -126,7 +126,7 @@ public function testExistingDefaultEntryPointUsed()
126126
'authenticators' => ['authenticator123'],
127127
'entry_point' => null,
128128
];
129-
list(, $entryPointId) = $this->executeCreate($config, 'some_default_entry_point');
129+
[, $entryPointId] = $this->executeCreate($config, 'some_default_entry_point');
130130
$this->assertEquals('some_default_entry_point', $entryPointId);
131131
}
132132

@@ -159,7 +159,7 @@ public function testCreateWithEntryPoint()
159159
'authenticators' => ['authenticator123', 'authenticatorABC'],
160160
'entry_point' => 'authenticatorABC',
161161
];
162-
list(, $entryPointId) = $this->executeCreate($config, null);
162+
[, $entryPointId] = $this->executeCreate($config, null);
163163
$this->assertEquals('authenticatorABC', $entryPointId);
164164
}
165165

@@ -172,7 +172,7 @@ private function executeCreate(array $config, $defaultEntryPointId)
172172
$userProviderId = 'my_user_provider';
173173

174174
$factory = new GuardAuthenticationFactory();
175-
list(, , $entryPointId) = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
175+
[, , $entryPointId] = $factory->create($container, $id, $config, $userProviderId, $defaultEntryPointId);
176176

177177
return [$container, $entryPointId];
178178
}

0 commit comments

Comments
 (0)