@@ -55,7 +55,7 @@ property they use to access their account via the API::
55
55
56
56
public function getRoles()
57
57
{
58
- return [ 'ROLE_USER'] ;
58
+ return array( 'ROLE_USER') ;
59
59
}
60
60
61
61
public function getPassword()
@@ -175,14 +175,14 @@ This requires you to implement six methods::
175
175
}
176
176
177
177
// What you return here will be passed to getUser() as $credentials
178
- return [
178
+ return array(
179
179
'token' => $token,
180
- ] ;
180
+ ) ;
181
181
}
182
182
183
183
public function getUser($credentials, UserProviderInterface $userProvider)
184
184
{
185
- $apiKey = $credentials[ 'token'];
185
+ $apiKey = $credentials'token'];
186
186
187
187
// if null, authentication will fail
188
188
// if a User object, checkCredentials() is called
@@ -206,12 +206,12 @@ This requires you to implement six methods::
206
206
207
207
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
208
208
{
209
- $data = [
209
+ $data = array(
210
210
'message' => strtr($exception->getMessageKey(), $exception->getMessageData())
211
211
212
212
// or to translate this message
213
213
// $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
214
- ] ;
214
+ ) ;
215
215
216
216
return new JsonResponse($data, Response::HTTP_FORBIDDEN);
217
217
}
@@ -221,10 +221,10 @@ This requires you to implement six methods::
221
221
*/
222
222
public function start(Request $request, AuthenticationException $authException = null)
223
223
{
224
- $data = [
224
+ $data = array(
225
225
// you might translate this message
226
226
'message' => 'Authentication Required'
227
- ] ;
227
+ ) ;
228
228
229
229
return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
230
230
}
0 commit comments