Skip to content

Commit 0ea88e5

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 d12589d + b1a8907 commit 0ea88e5

File tree

48 files changed

+271
-271
lines changed

Some content is hidden

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

48 files changed

+271
-271
lines changed

Authentication/RememberMe/InMemoryTokenProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class InMemoryTokenProvider implements TokenProviderInterface
2222
{
23-
private $tokens = array();
23+
private $tokens = [];
2424

2525
/**
2626
* {@inheritdoc}

Authentication/Token/AbstractToken.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
abstract class AbstractToken implements TokenInterface
2626
{
2727
private $user;
28-
private $roles = array();
28+
private $roles = [];
2929
private $authenticated = false;
30-
private $attributes = array();
30+
private $attributes = [];
3131

3232
/**
3333
* @param (Role|string)[] $roles An array of roles
3434
*
3535
* @throws \InvalidArgumentException
3636
*/
37-
public function __construct(array $roles = array())
37+
public function __construct(array $roles = [])
3838
{
3939
foreach ($roles as $role) {
4040
if (\is_string($role)) {
@@ -137,12 +137,12 @@ public function eraseCredentials()
137137
public function serialize()
138138
{
139139
return serialize(
140-
array(
140+
[
141141
\is_object($this->user) ? clone $this->user : $this->user,
142142
$this->authenticated,
143143
array_map(function ($role) { return clone $role; }, $this->roles),
144144
$this->attributes,
145-
)
145+
]
146146
);
147147
}
148148

@@ -223,7 +223,7 @@ public function __toString()
223223
$class = \get_class($this);
224224
$class = substr($class, strrpos($class, '\\') + 1);
225225

226-
$roles = array();
226+
$roles = [];
227227
foreach ($this->roles as $role) {
228228
$roles[] = $role->getRole();
229229
}

Authentication/Token/RememberMeToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ public function getCredentials()
9494
*/
9595
public function serialize()
9696
{
97-
return serialize(array(
97+
return serialize([
9898
$this->secret,
9999
$this->providerKey,
100100
parent::serialize(),
101-
));
101+
]);
102102
}
103103

104104
/**

Authorization/AuthorizationChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ final public function isGranted($attributes, $subject = null)
5454
}
5555

5656
if (!\is_array($attributes)) {
57-
$attributes = array($attributes);
57+
$attributes = [$attributes];
5858
}
5959

6060
return $this->accessDecisionManager->decide($token, $attributes, $subject);

Authorization/ExpressionLanguageProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
2323
{
2424
public function getFunctions()
2525
{
26-
return array(
26+
return [
2727
new ExpressionFunction('is_anonymous', function () {
2828
return '$trust_resolver->isAnonymous($token)';
2929
}, function (array $variables) {
@@ -53,6 +53,6 @@ public function getFunctions()
5353
}, function (array $variables, $role) {
5454
return \in_array($role, $variables['roles']);
5555
}),
56-
);
56+
];
5757
}
5858
}

Authorization/TraceableAccessDecisionManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class TraceableAccessDecisionManager implements AccessDecisionManagerInterface
2626
{
2727
private $manager;
2828
private $strategy;
29-
private $voters = array();
30-
private $decisionLog = array();
29+
private $voters = [];
30+
private $decisionLog = [];
3131

3232
public function __construct(AccessDecisionManagerInterface $manager)
3333
{
@@ -51,11 +51,11 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
5151
{
5252
$result = $this->manager->decide($token, $attributes, $object);
5353

54-
$this->decisionLog[] = array(
54+
$this->decisionLog[] = [
5555
'attributes' => $attributes,
5656
'object' => $object,
5757
'result' => $result,
58-
);
58+
];
5959

6060
return $result;
6161
}

Authorization/Voter/ExpressionVoter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ private function getVariables(TokenInterface $token, $subject)
8080
$roles = $token->getRoles();
8181
}
8282

83-
$variables = array(
83+
$variables = [
8484
'token' => $token,
8585
'user' => $token->getUser(),
8686
'object' => $subject,
8787
'subject' => $subject,
8888
'roles' => array_map(function ($role) { return $role->getRole(); }, $roles),
8989
'trust_resolver' => $this->trustResolver,
90-
);
90+
];
9191

9292
// this is mainly to propose a better experience when the expression is used
9393
// in an access control rule, as the developer does not know that it's going

Encoder/BCryptPasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function encodePassword($raw, $salt)
6464
throw new BadCredentialsException('Invalid password.');
6565
}
6666

67-
$options = array('cost' => $this->cost);
67+
$options = ['cost' => $this->cost];
6868

6969
if ($salt) {
7070
// Ignore $salt, the auto-generated one is always the best

Encoder/BasePasswordEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class BasePasswordEncoder implements PasswordEncoderInterface
3030
protected function demergePasswordAndSalt($mergedPasswordSalt)
3131
{
3232
if (empty($mergedPasswordSalt)) {
33-
return array('', '');
33+
return ['', ''];
3434
}
3535

3636
$password = $mergedPasswordSalt;
@@ -42,7 +42,7 @@ protected function demergePasswordAndSalt($mergedPasswordSalt)
4242
$password = substr($mergedPasswordSalt, 0, $saltBegins);
4343
}
4444

45-
return array($password, $salt);
45+
return [$password, $salt];
4646
}
4747

4848
/**

Exception/AccessDeniedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class AccessDeniedException extends RuntimeException
2020
{
21-
private $attributes = array();
21+
private $attributes = [];
2222
private $subject;
2323

2424
public function __construct(string $message = 'Access Denied.', \Exception $previous = null)

0 commit comments

Comments
 (0)