Skip to content

Commit 5943ec1

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents ba54e93 + 0242521 commit 5943ec1

File tree

44 files changed

+370
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+370
-370
lines changed

AccessMap.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*/
2323
class AccessMap implements AccessMapInterface
2424
{
25-
private $map = array();
25+
private $map = [];
2626

2727
/**
2828
* @param RequestMatcherInterface $requestMatcher A RequestMatcherInterface instance
2929
* @param array $attributes An array of attributes to pass to the access decision manager (like roles)
3030
* @param string|null $channel The channel to enforce (http, https, or null)
3131
*/
32-
public function add(RequestMatcherInterface $requestMatcher, array $attributes = array(), $channel = null)
32+
public function add(RequestMatcherInterface $requestMatcher, array $attributes = [], $channel = null)
3333
{
34-
$this->map[] = array($requestMatcher, $attributes, $channel);
34+
$this->map[] = [$requestMatcher, $attributes, $channel];
3535
}
3636

3737
/**
@@ -41,10 +41,10 @@ public function getPatterns(Request $request)
4141
{
4242
foreach ($this->map as $elements) {
4343
if (null === $elements[0] || $elements[0]->matches($request)) {
44-
return array($elements[1], $elements[2]);
44+
return [$elements[1], $elements[2]];
4545
}
4646
}
4747

48-
return array(null, null);
48+
return [null, null];
4949
}
5050
}

Authentication/DefaultAuthenticationFailureHandler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
3535
protected $httpUtils;
3636
protected $logger;
3737
protected $options;
38-
protected $defaultOptions = array(
38+
protected $defaultOptions = [
3939
'failure_path' => null,
4040
'failure_forward' => false,
4141
'login_path' => '/login',
4242
'failure_path_parameter' => '_failure_path',
43-
);
43+
];
4444

45-
public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = array(), LoggerInterface $logger = null)
45+
public function __construct(HttpKernelInterface $httpKernel, HttpUtils $httpUtils, array $options = [], LoggerInterface $logger = null)
4646
{
4747
$this->httpKernel = $httpKernel;
4848
$this->httpUtils = $httpUtils;
@@ -80,7 +80,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
8080

8181
if ($this->options['failure_forward']) {
8282
if (null !== $this->logger) {
83-
$this->logger->debug('Authentication failure, forward triggered.', array('failure_path' => $this->options['failure_path']));
83+
$this->logger->debug('Authentication failure, forward triggered.', ['failure_path' => $this->options['failure_path']]);
8484
}
8585

8686
$subRequest = $this->httpUtils->createRequest($request, $this->options['failure_path']);
@@ -90,7 +90,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
9090
}
9191

9292
if (null !== $this->logger) {
93-
$this->logger->debug('Authentication failure, redirect triggered.', array('failure_path' => $this->options['failure_path']));
93+
$this->logger->debug('Authentication failure, redirect triggered.', ['failure_path' => $this->options['failure_path']]);
9494
}
9595

9696
$request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception);

Authentication/DefaultAuthenticationSuccessHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
3131
protected $httpUtils;
3232
protected $options;
3333
protected $providerKey;
34-
protected $defaultOptions = array(
34+
protected $defaultOptions = [
3535
'always_use_default_target_path' => false,
3636
'default_target_path' => '/',
3737
'login_path' => '/login',
3838
'target_path_parameter' => '_target_path',
3939
'use_referer' => false,
40-
);
40+
];
4141

4242
/**
4343
* @param HttpUtils $httpUtils
4444
* @param array $options Options for processing a successful authentication attempt
4545
*/
46-
public function __construct(HttpUtils $httpUtils, array $options = array())
46+
public function __construct(HttpUtils $httpUtils, array $options = [])
4747
{
4848
$this->httpUtils = $httpUtils;
4949
$this->setOptions($options);

Authentication/SimpleAuthenticationHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token)
5555
{
5656
if ($this->simpleAuthenticator instanceof AuthenticationSuccessHandlerInterface) {
5757
if ($this->logger) {
58-
$this->logger->debug('Selected an authentication success handler.', array('handler' => \get_class($this->simpleAuthenticator)));
58+
$this->logger->debug('Selected an authentication success handler.', ['handler' => \get_class($this->simpleAuthenticator)]);
5959
}
6060

6161
$response = $this->simpleAuthenticator->onAuthenticationSuccess($request, $token);
@@ -82,7 +82,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
8282
{
8383
if ($this->simpleAuthenticator instanceof AuthenticationFailureHandlerInterface) {
8484
if ($this->logger) {
85-
$this->logger->debug('Selected an authentication failure handler.', array('handler' => \get_class($this->simpleAuthenticator)));
85+
$this->logger->debug('Selected an authentication failure handler.', ['handler' => \get_class($this->simpleAuthenticator)]);
8686
}
8787

8888
$response = $this->simpleAuthenticator->onAuthenticationFailure($request, $exception);

Firewall.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public function onKernelFinishRequest(FinishRequestEvent $event)
9999
*/
100100
public static function getSubscribedEvents()
101101
{
102-
return array(
103-
KernelEvents::REQUEST => array('onKernelRequest', 8),
102+
return [
103+
KernelEvents::REQUEST => ['onKernelRequest', 8],
104104
KernelEvents::FINISH_REQUEST => 'onKernelFinishRequest',
105-
);
105+
];
106106
}
107107

108108
protected function handleRequest(GetResponseEvent $event, $listeners)

Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ final public function handle(GetResponseEvent $event)
6666
}
6767

6868
if (null !== $this->logger) {
69-
$this->logger->debug('Checking current security token.', array('token' => (string) $this->tokenStorage->getToken()));
69+
$this->logger->debug('Checking current security token.', ['token' => (string) $this->tokenStorage->getToken()]);
7070
}
7171

7272
if (null !== $token = $this->tokenStorage->getToken()) {
@@ -76,14 +76,14 @@ final public function handle(GetResponseEvent $event)
7676
}
7777

7878
if (null !== $this->logger) {
79-
$this->logger->debug('Trying to pre-authenticate user.', array('username' => (string) $user));
79+
$this->logger->debug('Trying to pre-authenticate user.', ['username' => (string) $user]);
8080
}
8181

8282
try {
8383
$token = $this->authenticationManager->authenticate(new PreAuthenticatedToken($user, $credentials, $this->providerKey));
8484

8585
if (null !== $this->logger) {
86-
$this->logger->info('Pre-authentication successful.', array('token' => (string) $token));
86+
$this->logger->info('Pre-authentication successful.', ['token' => (string) $token]);
8787
}
8888

8989
$this->migrateSession($request, $token);
@@ -119,7 +119,7 @@ private function clearToken(AuthenticationException $exception)
119119
$this->tokenStorage->setToken(null);
120120

121121
if (null !== $this->logger) {
122-
$this->logger->info('Cleared security token due to an exception.', array('exception' => $exception));
122+
$this->logger->info('Cleared security token due to an exception.', ['exception' => $exception]);
123123
}
124124
}
125125
}

Firewall/AnonymousAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function handle(GetResponseEvent $event)
4949
}
5050

5151
try {
52-
$token = new AnonymousToken($this->secret, 'anon.', array());
52+
$token = new AnonymousToken($this->secret, 'anon.', []);
5353
if (null !== $this->authenticationManager) {
5454
$token = $this->authenticationManager->authenticate($token);
5555
}
@@ -61,7 +61,7 @@ public function handle(GetResponseEvent $event)
6161
}
6262
} catch (AuthenticationException $failed) {
6363
if (null !== $this->logger) {
64-
$this->logger->info('Anonymous authentication failed.', array('exception' => $failed));
64+
$this->logger->info('Anonymous authentication failed.', ['exception' => $failed]);
6565
}
6666
}
6767
}

Firewall/BasicAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function handle(GetResponseEvent $event)
6969
}
7070

7171
if (null !== $this->logger) {
72-
$this->logger->info('Basic authentication Authorization header found for user.', array('username' => $username));
72+
$this->logger->info('Basic authentication Authorization header found for user.', ['username' => $username]);
7373
}
7474

7575
try {
@@ -85,7 +85,7 @@ public function handle(GetResponseEvent $event)
8585
}
8686

8787
if (null !== $this->logger) {
88-
$this->logger->info('Basic authentication failed for user.', array('username' => $username, 'exception' => $e));
88+
$this->logger->info('Basic authentication failed for user.', ['username' => $username, 'exception' => $e]);
8989
}
9090

9191
if ($this->ignoreFailure) {

Firewall/ExceptionListener.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationT
7171
*/
7272
public function register(EventDispatcherInterface $dispatcher)
7373
{
74-
$dispatcher->addListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'), 1);
74+
$dispatcher->addListener(KernelEvents::EXCEPTION, [$this, 'onKernelException'], 1);
7575
}
7676

7777
/**
7878
* Unregisters the dispatcher.
7979
*/
8080
public function unregister(EventDispatcherInterface $dispatcher)
8181
{
82-
$dispatcher->removeListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'));
82+
$dispatcher->removeListener(KernelEvents::EXCEPTION, [$this, 'onKernelException']);
8383
}
8484

8585
/**
@@ -102,7 +102,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
102102
private function handleAuthenticationException(GetResponseForExceptionEvent $event, AuthenticationException $exception): void
103103
{
104104
if (null !== $this->logger) {
105-
$this->logger->info('An AuthenticationException was thrown; redirecting to authentication entry point.', array('exception' => $exception));
105+
$this->logger->info('An AuthenticationException was thrown; redirecting to authentication entry point.', ['exception' => $exception]);
106106
}
107107

108108
try {
@@ -120,7 +120,7 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
120120
$token = $this->tokenStorage->getToken();
121121
if (!$this->authenticationTrustResolver->isFullFledged($token)) {
122122
if (null !== $this->logger) {
123-
$this->logger->debug('Access denied, the user is not fully authenticated; redirecting to authentication entry point.', array('exception' => $exception));
123+
$this->logger->debug('Access denied, the user is not fully authenticated; redirecting to authentication entry point.', ['exception' => $exception]);
124124
}
125125

126126
try {
@@ -136,7 +136,7 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
136136
}
137137

138138
if (null !== $this->logger) {
139-
$this->logger->debug('Access denied, the user is neither anonymous, nor remember-me.', array('exception' => $exception));
139+
$this->logger->debug('Access denied, the user is neither anonymous, nor remember-me.', ['exception' => $exception]);
140140
}
141141

142142
try {
@@ -155,7 +155,7 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
155155
}
156156
} catch (\Exception $e) {
157157
if (null !== $this->logger) {
158-
$this->logger->error('An exception was thrown when handling an AccessDeniedException.', array('exception' => $e));
158+
$this->logger->error('An exception was thrown when handling an AccessDeniedException.', ['exception' => $e]);
159159
}
160160

161161
$event->setException(new \RuntimeException('Exception thrown when handling an exception.', 0, $e));
@@ -165,14 +165,14 @@ private function handleAccessDeniedException(GetResponseForExceptionEvent $event
165165
private function handleLogoutException(LogoutException $exception): void
166166
{
167167
if (null !== $this->logger) {
168-
$this->logger->info('A LogoutException was thrown.', array('exception' => $exception));
168+
$this->logger->info('A LogoutException was thrown.', ['exception' => $exception]);
169169
}
170170
}
171171

172172
private function startAuthentication(Request $request, AuthenticationException $authException): Response
173173
{
174174
if (null === $this->authenticationEntryPoint) {
175-
throw new HttpException(Response::HTTP_UNAUTHORIZED, $authException->getMessage(), $authException, array(), $authException->getCode());
175+
throw new HttpException(Response::HTTP_UNAUTHORIZED, $authException->getMessage(), $authException, [], $authException->getCode());
176176
}
177177

178178
if (null !== $this->logger) {
@@ -188,7 +188,7 @@ private function startAuthentication(Request $request, AuthenticationException $
188188
$this->tokenStorage->setToken(null);
189189

190190
if (null !== $this->logger) {
191-
$this->logger->info('The security token was removed due to an AccountStatusException.', array('exception' => $authException));
191+
$this->logger->info('The security token was removed due to an AccountStatusException.', ['exception' => $authException]);
192192
}
193193
}
194194

Firewall/LogoutListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ class LogoutListener implements ListenerInterface
4444
* @param array $options An array of options to process a logout attempt
4545
* @param CsrfTokenManagerInterface|null $csrfTokenManager A CsrfTokenManagerInterface instance
4646
*/
47-
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = array(), CsrfTokenManagerInterface $csrfTokenManager = null)
47+
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)
4848
{
4949
$this->tokenStorage = $tokenStorage;
5050
$this->httpUtils = $httpUtils;
51-
$this->options = array_merge(array(
51+
$this->options = array_merge([
5252
'csrf_parameter' => '_csrf_token',
5353
'csrf_token_id' => 'logout',
5454
'logout_path' => '/logout',
55-
), $options);
55+
], $options);
5656
$this->successHandler = $successHandler;
5757
$this->csrfTokenManager = $csrfTokenManager;
58-
$this->handlers = array();
58+
$this->handlers = [];
5959
}
6060

6161
public function addHandler(LogoutHandlerInterface $handler)

0 commit comments

Comments
 (0)