@@ -15,17 +15,17 @@ class ApiProblemTest extends TestCase
1515{
1616 public function statusCodes ()
1717 {
18- return array (
19- '200 ' => array ( 200 ) ,
20- '201 ' => array ( 201 ) ,
21- '300 ' => array ( 300 ) ,
22- '301 ' => array ( 301 ) ,
23- '302 ' => array ( 302 ) ,
24- '400 ' => array ( 400 ) ,
25- '401 ' => array ( 401 ) ,
26- '404 ' => array ( 404 ) ,
27- '500 ' => array ( 500 ) ,
28- ) ;
18+ return [
19+ '200 ' => [ 200 ] ,
20+ '201 ' => [ 201 ] ,
21+ '300 ' => [ 300 ] ,
22+ '301 ' => [ 301 ] ,
23+ '302 ' => [ 302 ] ,
24+ '400 ' => [ 400 ] ,
25+ '401 ' => [ 401 ] ,
26+ '404 ' => [ 404 ] ,
27+ '500 ' => [ 500 ] ,
28+ ] ;
2929 }
3030
3131 /**
@@ -86,13 +86,13 @@ public function testExceptionsCanTriggerInclusionOfNestedExceptions()
8686 $ payload = $ apiProblem ->toArray ();
8787 $ this ->assertArrayHasKey ('exception_stack ' , $ payload );
8888 $ this ->assertInternalType ('array ' , $ payload ['exception_stack ' ]);
89- $ expected = array (
90- array (
89+ $ expected = [
90+ [
9191 'code ' => $ exceptionChild ->getCode (),
9292 'message ' => $ exceptionChild ->getMessage (),
9393 'trace ' => $ exceptionChild ->getTrace (),
94- ) ,
95- ) ;
94+ ] ,
95+ ] ;
9696 $ this ->assertEquals ($ expected , $ payload ['exception_stack ' ]);
9797 }
9898
@@ -106,12 +106,12 @@ public function testTypeUrlIsUsedVerbatim()
106106
107107 public function knownStatusCodes ()
108108 {
109- return array (
110- '404 ' => array ( 404 ) ,
111- '409 ' => array ( 409 ) ,
112- '422 ' => array ( 422 ) ,
113- '500 ' => array ( 500 ) ,
114- ) ;
109+ return [
110+ '404 ' => [ 404 ] ,
111+ '409 ' => [ 409 ] ,
112+ '422 ' => [ 422 ] ,
113+ '500 ' => [ 500 ] ,
114+ ] ;
115115 }
116116
117117 /**
@@ -153,7 +153,7 @@ public function testCanPassArbitraryDetailsToConstructor()
153153 'Invalid input ' ,
154154 'http://example.com/api/problem/400 ' ,
155155 'Invalid entity ' ,
156- array ( 'foo ' => 'bar ' )
156+ [ 'foo ' => 'bar ' ]
157157 );
158158 $ this ->assertEquals ('bar ' , $ problem ->foo );
159159 }
@@ -165,7 +165,7 @@ public function testArraySerializationIncludesArbitraryDetails()
165165 'Invalid input ' ,
166166 'http://example.com/api/problem/400 ' ,
167167 'Invalid entity ' ,
168- array ( 'foo ' => 'bar ' )
168+ [ 'foo ' => 'bar ' ]
169169 );
170170 $ array = $ problem ->toArray ();
171171 $ this ->assertArrayHasKey ('foo ' , $ array );
@@ -179,7 +179,7 @@ public function testArbitraryDetailsShouldNotOverwriteRequiredFieldsInArraySeria
179179 'Invalid input ' ,
180180 'http://example.com/api/problem/400 ' ,
181181 'Invalid entity ' ,
182- array ( 'title ' => 'SHOULD NOT GET THIS ' )
182+ [ 'title ' => 'SHOULD NOT GET THIS ' ]
183183 );
184184 $ array = $ problem ->toArray ();
185185 $ this ->assertArrayHasKey ('title ' , $ array );
@@ -209,7 +209,7 @@ public function testUsesTypeFromExceptionWhenProvided()
209209 public function testUsesAdditionalDetailsFromExceptionWhenProvided ()
210210 {
211211 $ exception = new Exception \DomainException ('exception message ' , 401 );
212- $ exception ->setAdditionalDetails (array ( 'foo ' => 'bar ' ) );
212+ $ exception ->setAdditionalDetails ([ 'foo ' => 'bar ' ] );
213213 $ apiProblem = new ApiProblem ('401 ' , $ exception );
214214 $ payload = $ apiProblem ->toArray ();
215215 $ this ->assertArrayHasKey ('foo ' , $ payload );
@@ -218,13 +218,13 @@ public function testUsesAdditionalDetailsFromExceptionWhenProvided()
218218
219219 public function invalidStatusCodes ()
220220 {
221- return array (
222- '-1 ' => array (- 1 ) ,
223- '0 ' => array ( 0 ) ,
224- '7 ' => array ( 7 ) , // reported
225- '14 ' => array ( 14 ) , // observed
226- '600 ' => array ( 600 ) ,
227- ) ;
221+ return [
222+ '-1 ' => [- 1 ] ,
223+ '0 ' => [ 0 ] ,
224+ '7 ' => [ 7 ] , // reported
225+ '14 ' => [ 14 ] , // observed
226+ '600 ' => [ 600 ] ,
227+ ] ;
228228 }
229229
230230 /**
0 commit comments