Skip to content

Commit 0582c7c

Browse files
javiereguiluzxabbuh
authored andcommitted
Reverted the short array notation
1 parent 9c1541e commit 0582c7c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

security/guard_authentication.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ property they use to access their account via the API::
5555

5656
public function getRoles()
5757
{
58-
return ['ROLE_USER'];
58+
return array('ROLE_USER');
5959
}
6060

6161
public function getPassword()
@@ -175,14 +175,14 @@ This requires you to implement six methods::
175175
}
176176

177177
// What you return here will be passed to getUser() as $credentials
178-
return [
178+
return array(
179179
'token' => $token,
180-
];
180+
);
181181
}
182182

183183
public function getUser($credentials, UserProviderInterface $userProvider)
184184
{
185-
$apiKey = $credentials['token'];
185+
$apiKey = $credentials'token'];
186186

187187
// if null, authentication will fail
188188
// if a User object, checkCredentials() is called
@@ -206,12 +206,12 @@ This requires you to implement six methods::
206206

207207
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
208208
{
209-
$data = [
209+
$data = array(
210210
'message' => strtr($exception->getMessageKey(), $exception->getMessageData())
211211

212212
// or to translate this message
213213
// $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
214-
];
214+
);
215215

216216
return new JsonResponse($data, Response::HTTP_FORBIDDEN);
217217
}
@@ -221,10 +221,10 @@ This requires you to implement six methods::
221221
*/
222222
public function start(Request $request, AuthenticationException $authException = null)
223223
{
224-
$data = [
224+
$data = array(
225225
// you might translate this message
226226
'message' => 'Authentication Required'
227-
];
227+
);
228228

229229
return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
230230
}

0 commit comments

Comments
 (0)