@@ -36,14 +36,14 @@ public static function setUpBeforeClass()
3636
3737 public function testAutoLoginReturnsNullWhenNoCookie ()
3838 {
39- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' ) );
39+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' ] );
4040
4141 $ this ->assertNull ($ service ->autoLogin (new Request ()));
4242 }
4343
4444 public function testAutoLoginThrowsExceptionOnInvalidCookie ()
4545 {
46- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => false , 'remember_me_parameter ' => 'foo ' ) );
46+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => false , 'remember_me_parameter ' => 'foo ' ] );
4747 $ request = new Request ();
4848 $ request ->request ->set ('foo ' , 'true ' );
4949 $ request ->cookies ->set ('foo ' , 'foo ' );
@@ -54,13 +54,13 @@ public function testAutoLoginThrowsExceptionOnInvalidCookie()
5454
5555 public function testAutoLoginThrowsExceptionOnNonExistentToken ()
5656 {
57- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => false , 'remember_me_parameter ' => 'foo ' ) );
57+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => false , 'remember_me_parameter ' => 'foo ' ] );
5858 $ request = new Request ();
5959 $ request ->request ->set ('foo ' , 'true ' );
60- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array (
60+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([
6161 $ series = 'fooseries ' ,
6262 $ tokenValue = 'foovalue ' ,
63- ) ));
63+ ] ));
6464
6565 $ tokenProvider = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface ' )->getMock ();
6666 $ tokenProvider
@@ -77,9 +77,9 @@ public function testAutoLoginThrowsExceptionOnNonExistentToken()
7777 public function testAutoLoginReturnsNullOnNonExistentUser ()
7878 {
7979 $ userProvider = $ this ->getProvider ();
80- $ service = $ this ->getService ($ userProvider , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true , 'lifetime ' => 3600 , 'secure ' => false , 'httponly ' => false ) );
80+ $ service = $ this ->getService ($ userProvider , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true , 'lifetime ' => 3600 , 'secure ' => false , 'httponly ' => false ] );
8181 $ request = new Request ();
82- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array ( 'fooseries ' , 'foovalue ' ) ));
82+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([ 'fooseries ' , 'foovalue ' ] ));
8383
8484 $ tokenProvider = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface ' )->getMock ();
8585 $ tokenProvider
@@ -102,9 +102,9 @@ public function testAutoLoginReturnsNullOnNonExistentUser()
102102 public function testAutoLoginThrowsExceptionOnStolenCookieAndRemovesItFromThePersistentBackend ()
103103 {
104104 $ userProvider = $ this ->getProvider ();
105- $ service = $ this ->getService ($ userProvider , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true ) );
105+ $ service = $ this ->getService ($ userProvider , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true ] );
106106 $ request = new Request ();
107- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array ( 'fooseries ' , 'foovalue ' ) ));
107+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([ 'fooseries ' , 'foovalue ' ] ));
108108
109109 $ tokenProvider = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface ' )->getMock ();
110110 $ service ->setTokenProvider ($ tokenProvider );
@@ -133,9 +133,9 @@ public function testAutoLoginThrowsExceptionOnStolenCookieAndRemovesItFromThePer
133133
134134 public function testAutoLoginDoesNotAcceptAnExpiredCookie ()
135135 {
136- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true , 'lifetime ' => 3600 ) );
136+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'always_remember_me ' => true , 'lifetime ' => 3600 ] );
137137 $ request = new Request ();
138- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array ( 'fooseries ' , 'foovalue ' ) ));
138+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([ 'fooseries ' , 'foovalue ' ] ));
139139
140140 $ tokenProvider = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface ' )->getMock ();
141141 $ tokenProvider
@@ -156,7 +156,7 @@ public function testAutoLogin()
156156 $ user
157157 ->expects ($ this ->once ())
158158 ->method ('getRoles ' )
159- ->will ($ this ->returnValue (array ( 'ROLE_FOO ' ) ))
159+ ->will ($ this ->returnValue ([ 'ROLE_FOO ' ] ))
160160 ;
161161
162162 $ userProvider = $ this ->getProvider ();
@@ -167,9 +167,9 @@ public function testAutoLogin()
167167 ->will ($ this ->returnValue ($ user ))
168168 ;
169169
170- $ service = $ this ->getService ($ userProvider , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'secure ' => false , 'httponly ' => false , 'always_remember_me ' => true , 'lifetime ' => 3600 ) );
170+ $ service = $ this ->getService ($ userProvider , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null , 'secure ' => false , 'httponly ' => false , 'always_remember_me ' => true , 'lifetime ' => 3600 ] );
171171 $ request = new Request ();
172- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array ( 'fooseries ' , 'foovalue ' ) ));
172+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([ 'fooseries ' , 'foovalue ' ] ));
173173
174174 $ tokenProvider = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface ' )->getMock ();
175175 $ tokenProvider
@@ -190,9 +190,9 @@ public function testAutoLogin()
190190
191191 public function testLogout ()
192192 {
193- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => '/foo ' , 'domain ' => 'foodomain.foo ' , 'secure ' => true , 'httponly ' => false ) );
193+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => '/foo ' , 'domain ' => 'foodomain.foo ' , 'secure ' => true , 'httponly ' => false ] );
194194 $ request = new Request ();
195- $ request ->cookies ->set ('foo ' , $ this ->encodeCookie (array ( 'fooseries ' , 'foovalue ' ) ));
195+ $ request ->cookies ->set ('foo ' , $ this ->encodeCookie ([ 'fooseries ' , 'foovalue ' ] ));
196196 $ response = new Response ();
197197 $ token = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
198198
@@ -217,7 +217,7 @@ public function testLogout()
217217
218218 public function testLogoutSimplyIgnoresNonSetRequestCookie ()
219219 {
220- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ) );
220+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ] );
221221 $ request = new Request ();
222222 $ response = new Response ();
223223 $ token = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
@@ -239,7 +239,7 @@ public function testLogoutSimplyIgnoresNonSetRequestCookie()
239239
240240 public function testLogoutSimplyIgnoresInvalidCookie ()
241241 {
242- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ) );
242+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ] );
243243 $ request = new Request ();
244244 $ request ->cookies ->set ('foo ' , 'somefoovalue ' );
245245 $ response = new Response ();
@@ -259,7 +259,7 @@ public function testLogoutSimplyIgnoresInvalidCookie()
259259
260260 public function testLoginFail ()
261261 {
262- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ) );
262+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'path ' => null , 'domain ' => null ] );
263263 $ request = new Request ();
264264
265265 $ this ->assertFalse ($ request ->attributes ->has (RememberMeServicesInterface::COOKIE_ATTR_NAME ));
@@ -269,7 +269,7 @@ public function testLoginFail()
269269
270270 public function testLoginSuccessSetsCookieWhenLoggedInWithNonRememberMeTokenInterfaceImplementation ()
271271 {
272- $ service = $ this ->getService (null , array ( 'name ' => 'foo ' , 'domain ' => 'myfoodomain.foo ' , 'path ' => '/foo/path ' , 'secure ' => true , 'httponly ' => true , 'samesite ' => Cookie::SAMESITE_STRICT , 'lifetime ' => 3600 , 'always_remember_me ' => true ) );
272+ $ service = $ this ->getService (null , [ 'name ' => 'foo ' , 'domain ' => 'myfoodomain.foo ' , 'path ' => '/foo/path ' , 'secure ' => true , 'httponly ' => true , 'samesite ' => Cookie::SAMESITE_STRICT , 'lifetime ' => 3600 , 'always_remember_me ' => true ] );
273273 $ request = new Request ();
274274 $ response = new Response ();
275275
@@ -318,13 +318,13 @@ protected function encodeCookie(array $parts)
318318 return $ r ->invoke ($ service , $ parts );
319319 }
320320
321- protected function getService ($ userProvider = null , $ options = array () , $ logger = null )
321+ protected function getService ($ userProvider = null , $ options = [] , $ logger = null )
322322 {
323323 if (null === $ userProvider ) {
324324 $ userProvider = $ this ->getProvider ();
325325 }
326326
327- return new PersistentTokenBasedRememberMeServices (array ( $ userProvider) , 'foosecret ' , 'fookey ' , $ options , $ logger );
327+ return new PersistentTokenBasedRememberMeServices ([ $ userProvider] , 'foosecret ' , 'fookey ' , $ options , $ logger );
328328 }
329329
330330 protected function getProvider ()
0 commit comments