Skip to content

Commit 4379470

Browse files
committed
Merge branch '4.4' into 5.1
2 parents 01fc5b3 + 44d7fe4 commit 4379470

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

Firewall/ChannelListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(AccessMapInterface $map, AuthenticationEntryPointInt
4343
*/
4444
public function supports(Request $request): ?bool
4545
{
46-
list(, $channel) = $this->map->getPatterns($request);
46+
[, $channel] = $this->map->getPatterns($request);
4747

4848
if ('https' === $channel && !$request->isSecure()) {
4949
if (null !== $this->logger) {

Logout/LogoutUrlGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function setCurrentFirewall(?string $key, string $context = null)
8484
*/
8585
private function generateLogoutUrl(?string $key, int $referenceType): string
8686
{
87-
list($logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager) = $this->getListener($key);
87+
[$logoutPath, $csrfTokenId, $csrfParameter, $csrfTokenManager] = $this->getListener($key);
8888

8989
if (null === $logoutPath) {
9090
throw new \LogicException('Unable to generate the logout URL without a path.');
@@ -146,7 +146,7 @@ private function getListener(?string $key): array
146146
}
147147

148148
// Fetch from injected current firewall information, if possible
149-
list($key, $context) = $this->currentFirewall;
149+
[$key, $context] = $this->currentFirewall;
150150

151151
if (isset($this->listeners[$key])) {
152152
return $this->listeners[$key];

RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function cancelCookie(Request $request)
5252
if (null !== ($cookie = $request->cookies->get($this->options['name']))
5353
&& 2 === \count($parts = $this->decodeCookie($cookie))
5454
) {
55-
list($series) = $parts;
55+
[$series] = $parts;
5656
$this->tokenProvider->deleteTokenBySeries($series);
5757
}
5858
}
@@ -66,7 +66,7 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
6666
throw new AuthenticationException('The cookie is invalid.');
6767
}
6868

69-
list($series, $tokenValue) = $cookieParts;
69+
[$series, $tokenValue] = $cookieParts;
7070
$persistentToken = $this->tokenProvider->loadTokenBySeries($series);
7171

7272
if (!$this->isTokenValueValid($persistentToken, $tokenValue)) {

RememberMe/TokenBasedRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
3535
throw new AuthenticationException('The cookie is invalid.');
3636
}
3737

38-
list($class, $username, $expires, $hash) = $cookieParts;
38+
[$class, $username, $expires, $hash] = $cookieParts;
3939
if (false === $username = base64_decode($username, true)) {
4040
throw new AuthenticationException('$username contains a character from outside the base64 alphabet.');
4141
}

Tests/Firewall/LogoutListenerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testHandleUnmatchedPath()
3030
$dispatcher = $this->getEventDispatcher();
3131
list($listener, , $httpUtils, $options) = $this->getListener($dispatcher);
3232

33-
list($event, $request) = $this->getGetResponseEvent();
33+
[$event, $request] = $this->getGetResponseEvent();
3434

3535
$logoutEventDispatched = false;
3636
$dispatcher->addListener(LogoutEvent::class, function (LogoutEvent $event) use (&$logoutEventDispatched) {
@@ -54,7 +54,7 @@ public function testHandleMatchedPathWithCsrfValidation()
5454

5555
list($listener, $tokenStorage, $httpUtils, $options) = $this->getListener($dispatcher, $tokenManager);
5656

57-
list($event, $request) = $this->getGetResponseEvent();
57+
[$event, $request] = $this->getGetResponseEvent();
5858

5959
$request->query->set('_csrf_token', 'token');
6060

@@ -92,7 +92,7 @@ public function testHandleMatchedPathWithoutCsrfValidation()
9292
$dispatcher = $this->getEventDispatcher();
9393
list($listener, $tokenStorage, $httpUtils, $options) = $this->getListener($dispatcher);
9494

95-
list($event, $request) = $this->getGetResponseEvent();
95+
[$event, $request] = $this->getGetResponseEvent();
9696

9797
$httpUtils->expects($this->once())
9898
->method('checkRequestPath')
@@ -125,7 +125,7 @@ public function testNoResponseSet()
125125

126126
list($listener, , $httpUtils, $options) = $this->getListener();
127127

128-
list($event, $request) = $this->getGetResponseEvent();
128+
[$event, $request] = $this->getGetResponseEvent();
129129

130130
$httpUtils->expects($this->once())
131131
->method('checkRequestPath')
@@ -140,9 +140,9 @@ public function testCsrfValidationFails()
140140
$this->expectException('Symfony\Component\Security\Core\Exception\LogoutException');
141141
$tokenManager = $this->getTokenManager();
142142

143-
list($listener, , $httpUtils, $options) = $this->getListener(null, $tokenManager);
143+
[$listener, , $httpUtils, $options] = $this->getListener(null, $tokenManager);
144144

145-
list($event, $request) = $this->getGetResponseEvent();
145+
[$event, $request] = $this->getGetResponseEvent();
146146

147147
$request->query->set('_csrf_token', 'token');
148148

Tests/Firewall/RememberMeListenerTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RememberMeListenerTest extends TestCase
2525
{
2626
public function testOnCoreSecurityDoesNotTryToPopulateNonEmptyTokenStorage()
2727
{
28-
list($listener, $tokenStorage) = $this->getListener();
28+
[$listener, $tokenStorage] = $this->getListener();
2929

3030
$tokenStorage
3131
->expects($this->any())
@@ -43,7 +43,7 @@ public function testOnCoreSecurityDoesNotTryToPopulateNonEmptyTokenStorage()
4343

4444
public function testOnCoreSecurityDoesNothingWhenNoCookieIsSet()
4545
{
46-
list($listener, $tokenStorage, $service) = $this->getListener();
46+
[$listener, $tokenStorage, $service] = $this->getListener();
4747

4848
$tokenStorage
4949
->expects($this->any())
@@ -64,7 +64,7 @@ public function testOnCoreSecurityDoesNothingWhenNoCookieIsSet()
6464

6565
public function testOnCoreSecurityIgnoresAuthenticationExceptionThrownByAuthenticationManagerImplementation()
6666
{
67-
list($listener, $tokenStorage, $service, $manager) = $this->getListener();
67+
[$listener, $tokenStorage, $service, $manager] = $this->getListener();
6868
$request = new Request();
6969
$exception = new AuthenticationException('Authentication failed.');
7070

@@ -101,7 +101,7 @@ public function testOnCoreSecurityIgnoresAuthenticationOptionallyRethrowsExcepti
101101
{
102102
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationException');
103103
$this->expectExceptionMessage('Authentication failed.');
104-
list($listener, $tokenStorage, $service, $manager) = $this->getListener(false, false);
104+
[$listener, $tokenStorage, $service, $manager] = $this->getListener(false, false);
105105

106106
$tokenStorage
107107
->expects($this->any())
@@ -134,7 +134,7 @@ public function testOnCoreSecurityIgnoresAuthenticationOptionallyRethrowsExcepti
134134

135135
public function testOnCoreSecurityAuthenticationExceptionDuringAutoLoginTriggersLoginFail()
136136
{
137-
list($listener, $tokenStorage, $service, $manager) = $this->getListener();
137+
[$listener, $tokenStorage, $service, $manager] = $this->getListener();
138138

139139
$tokenStorage
140140
->expects($this->any())
@@ -166,7 +166,7 @@ public function testOnCoreSecurityAuthenticationExceptionDuringAutoLoginTriggers
166166

167167
public function testOnCoreSecurity()
168168
{
169-
list($listener, $tokenStorage, $service, $manager) = $this->getListener();
169+
[$listener, $tokenStorage, $service, $manager] = $this->getListener();
170170

171171
$tokenStorage
172172
->expects($this->any())
@@ -200,7 +200,7 @@ public function testOnCoreSecurity()
200200

201201
public function testSessionStrategy()
202202
{
203-
list($listener, $tokenStorage, $service, $manager, , , $sessionStrategy) = $this->getListener(false, true, true);
203+
[$listener, $tokenStorage, $service, $manager, , , $sessionStrategy] = $this->getListener(false, true, true);
204204

205205
$tokenStorage
206206
->expects($this->any())
@@ -250,7 +250,7 @@ public function testSessionStrategy()
250250

251251
public function testSessionIsMigratedByDefault()
252252
{
253-
list($listener, $tokenStorage, $service, $manager) = $this->getListener(false, true, false);
253+
[$listener, $tokenStorage, $service, $manager] = $this->getListener(false, true, false);
254254

255255
$tokenStorage
256256
->expects($this->any())
@@ -298,7 +298,7 @@ public function testSessionIsMigratedByDefault()
298298

299299
public function testOnCoreSecurityInteractiveLoginEventIsDispatchedIfDispatcherIsPresent()
300300
{
301-
list($listener, $tokenStorage, $service, $manager, , $dispatcher) = $this->getListener(true);
301+
[$listener, $tokenStorage, $service, $manager, , $dispatcher] = $this->getListener(true);
302302

303303
$tokenStorage
304304
->expects($this->any())

Tests/FirewallMapTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testGetListeners()
5353

5454
$map->add($tooLateMatcher, [function () {}]);
5555

56-
list($listeners, $exception) = $map->getListeners($request);
56+
[$listeners, $exception] = $map->getListeners($request);
5757

5858
$this->assertEquals([$theListener], $listeners);
5959
$this->assertEquals($theException, $exception);
@@ -88,7 +88,7 @@ public function testGetListenersWithAnEntryHavingNoRequestMatcher()
8888

8989
$map->add($tooLateMatcher, [function () {}]);
9090

91-
list($listeners, $exception) = $map->getListeners($request);
91+
[$listeners, $exception] = $map->getListeners($request);
9292

9393
$this->assertEquals([$theListener], $listeners);
9494
$this->assertEquals($theException, $exception);
@@ -110,7 +110,7 @@ public function testGetListenersWithNoMatchingEntry()
110110

111111
$map->add($notMatchingMatcher, [function () {}]);
112112

113-
list($listeners, $exception) = $map->getListeners($request);
113+
[$listeners, $exception] = $map->getListeners($request);
114114

115115
$this->assertEquals([], $listeners);
116116
$this->assertNull($exception);

0 commit comments

Comments
 (0)