@@ -24,66 +24,66 @@ public function testTransform()
2424 {
2525 $ transformer = new DateIntervalToArrayTransformer ();
2626 $ input = new \DateInterval ('P1Y2M3DT4H5M6S ' );
27- $ output = array (
27+ $ output = [
2828 'years ' => '1 ' ,
2929 'months ' => '2 ' ,
3030 'days ' => '3 ' ,
3131 'hours ' => '4 ' ,
3232 'minutes ' => '5 ' ,
3333 'seconds ' => '6 ' ,
3434 'invert ' => false ,
35- ) ;
35+ ] ;
3636 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
3737 }
3838
3939 public function testTransformEmpty ()
4040 {
4141 $ transformer = new DateIntervalToArrayTransformer ();
42- $ output = array (
42+ $ output = [
4343 'years ' => '' ,
4444 'months ' => '' ,
4545 'days ' => '' ,
4646 'hours ' => '' ,
4747 'minutes ' => '' ,
4848 'seconds ' => '' ,
4949 'invert ' => false ,
50- ) ;
50+ ] ;
5151 $ this ->assertSame ($ output , $ transformer ->transform (null ));
5252 }
5353
5454 public function testTransformEmptyWithFields ()
5555 {
56- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'weeks ' , 'minutes ' , 'seconds ' ) );
57- $ output = array (
56+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'weeks ' , 'minutes ' , 'seconds ' ] );
57+ $ output = [
5858 'years ' => '' ,
5959 'weeks ' => '' ,
6060 'minutes ' => '' ,
6161 'seconds ' => '' ,
62- ) ;
62+ ] ;
6363 $ this ->assertSame ($ output , $ transformer ->transform (null ));
6464 }
6565
6666 public function testTransformWithFields ()
6767 {
68- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'minutes ' , 'seconds ' ) );
68+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'minutes ' , 'seconds ' ] );
6969 $ input = new \DateInterval ('P1Y2M3DT4H5M6S ' );
70- $ output = array (
70+ $ output = [
7171 'years ' => '1 ' ,
7272 'minutes ' => '5 ' ,
7373 'seconds ' => '6 ' ,
74- ) ;
74+ ] ;
7575 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
7676 }
7777
7878 public function testTransformWithWeek ()
7979 {
80- $ transformer = new DateIntervalToArrayTransformer (array ( 'weeks ' , 'minutes ' , 'seconds ' ) );
80+ $ transformer = new DateIntervalToArrayTransformer ([ 'weeks ' , 'minutes ' , 'seconds ' ] );
8181 $ input = new \DateInterval ('P1Y2M3WT4H5M6S ' );
82- $ output = array (
82+ $ output = [
8383 'weeks ' => '3 ' ,
8484 'minutes ' => '5 ' ,
8585 'seconds ' => '6 ' ,
86- ) ;
86+ ] ;
8787 $ input = $ transformer ->transform ($ input );
8888 ksort ($ input );
8989 ksort ($ output );
@@ -92,13 +92,13 @@ public function testTransformWithWeek()
9292
9393 public function testTransformWithZeroWeek ()
9494 {
95- $ transformer = new DateIntervalToArrayTransformer (array ( 'weeks ' , 'minutes ' , 'seconds ' ) );
95+ $ transformer = new DateIntervalToArrayTransformer ([ 'weeks ' , 'minutes ' , 'seconds ' ] );
9696 $ input = new \DateInterval ('P1Y2M0WT4H5M6S ' );
97- $ output = array (
97+ $ output = [
9898 'weeks ' => '0 ' ,
9999 'minutes ' => '5 ' ,
100100 'seconds ' => '6 ' ,
101- ) ;
101+ ] ;
102102 $ input = $ transformer ->transform ($ input );
103103 ksort ($ input );
104104 ksort ($ output );
@@ -107,13 +107,13 @@ public function testTransformWithZeroWeek()
107107
108108 public function testTransformDaysToWeeks ()
109109 {
110- $ transformer = new DateIntervalToArrayTransformer (array ( 'weeks ' , 'minutes ' , 'seconds ' ) );
110+ $ transformer = new DateIntervalToArrayTransformer ([ 'weeks ' , 'minutes ' , 'seconds ' ] );
111111 $ input = new \DateInterval ('P1Y2M23DT4H5M6S ' );
112- $ output = array (
112+ $ output = [
113113 'weeks ' => '3 ' ,
114114 'minutes ' => '5 ' ,
115115 'seconds ' => '6 ' ,
116- ) ;
116+ ] ;
117117 $ input = $ transformer ->transform ($ input );
118118 ksort ($ input );
119119 ksort ($ output );
@@ -122,53 +122,53 @@ public function testTransformDaysToWeeks()
122122
123123 public function testTransformDaysNotOverflowingToWeeks ()
124124 {
125- $ transformer = new DateIntervalToArrayTransformer (array ( 'days ' , 'minutes ' , 'seconds ' ) );
125+ $ transformer = new DateIntervalToArrayTransformer ([ 'days ' , 'minutes ' , 'seconds ' ] );
126126 $ input = new \DateInterval ('P1Y2M23DT4H5M6S ' );
127- $ output = array (
127+ $ output = [
128128 'days ' => '23 ' ,
129129 'minutes ' => '5 ' ,
130130 'seconds ' => '6 ' ,
131- ) ;
131+ ] ;
132132 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
133133 }
134134
135135 public function testTransformWithInvert ()
136136 {
137- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'invert ' ) );
137+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'invert ' ] );
138138 $ input = new \DateInterval ('P1Y ' );
139139 $ input ->invert = 1 ;
140- $ output = array (
140+ $ output = [
141141 'years ' => '1 ' ,
142142 'invert ' => true ,
143- ) ;
143+ ] ;
144144 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
145145 }
146146
147147 public function testTransformWithPadding ()
148148 {
149149 $ transformer = new DateIntervalToArrayTransformer (null , true );
150150 $ input = new \DateInterval ('P1Y2M3DT4H5M6S ' );
151- $ output = array (
151+ $ output = [
152152 'years ' => '01 ' ,
153153 'months ' => '02 ' ,
154154 'days ' => '03 ' ,
155155 'hours ' => '04 ' ,
156156 'minutes ' => '05 ' ,
157157 'seconds ' => '06 ' ,
158158 'invert ' => false ,
159- ) ;
159+ ] ;
160160 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
161161 }
162162
163163 public function testTransformWithFieldsAndPadding ()
164164 {
165- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'minutes ' , 'seconds ' ) , true );
165+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'minutes ' , 'seconds ' ] , true );
166166 $ input = new \DateInterval ('P1Y2M3DT4H5M6S ' );
167- $ output = array (
167+ $ output = [
168168 'years ' => '01 ' ,
169169 'minutes ' => '05 ' ,
170170 'seconds ' => '06 ' ,
171- ) ;
171+ ] ;
172172 $ this ->assertSame ($ output , $ transformer ->transform ($ input ));
173173 }
174174
@@ -183,19 +183,19 @@ public function testReverseTransformRequiresDateTime()
183183 public function testReverseTransformWithUnsetFields ()
184184 {
185185 $ transformer = new DateIntervalToArrayTransformer ();
186- $ input = array ( 'years ' => '1 ' ) ;
186+ $ input = [ 'years ' => '1 ' ] ;
187187 $ this ->expectException (TransformationFailedException::class);
188188 $ transformer ->reverseTransform ($ input );
189189 }
190190
191191 public function testReverseTransformWithEmptyFields ()
192192 {
193- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'minutes ' , 'seconds ' ) );
194- $ input = array (
193+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'minutes ' , 'seconds ' ] );
194+ $ input = [
195195 'years ' => '1 ' ,
196196 'minutes ' => '' ,
197197 'seconds ' => '6 ' ,
198- ) ;
198+ ] ;
199199 if (method_exists ($ this , 'expectException ' )) {
200200 $ this ->expectException (TransformationFailedException::class);
201201 $ this ->expectExceptionMessage ('This amount of "minutes" is invalid ' );
@@ -207,10 +207,10 @@ public function testReverseTransformWithEmptyFields()
207207
208208 public function testReverseTransformWithWrongInvertType ()
209209 {
210- $ transformer = new DateIntervalToArrayTransformer (array ( 'invert ' ) );
211- $ input = array (
210+ $ transformer = new DateIntervalToArrayTransformer ([ 'invert ' ] );
211+ $ input = [
212212 'invert ' => '1 ' ,
213- ) ;
213+ ] ;
214214 if (method_exists ($ this , 'expectException ' )) {
215215 $ this ->expectException (TransformationFailedException::class);
216216 $ this ->expectExceptionMessage ('The value of "invert" must be boolean ' );
@@ -223,62 +223,62 @@ public function testReverseTransformWithWrongInvertType()
223223 public function testReverseTransform ()
224224 {
225225 $ transformer = new DateIntervalToArrayTransformer ();
226- $ input = array (
226+ $ input = [
227227 'years ' => '1 ' ,
228228 'months ' => '2 ' ,
229229 'days ' => '3 ' ,
230230 'hours ' => '4 ' ,
231231 'minutes ' => '5 ' ,
232232 'seconds ' => '6 ' ,
233233 'invert ' => false ,
234- ) ;
234+ ] ;
235235 $ output = new \DateInterval ('P01Y02M03DT04H05M06S ' );
236236 $ this ->assertDateIntervalEquals ($ output , $ transformer ->reverseTransform ($ input ));
237237 }
238238
239239 public function testReverseTransformWithWeek ()
240240 {
241241 $ transformer = new DateIntervalToArrayTransformer (
242- array ( 'years ' , 'months ' , 'weeks ' , 'hours ' , 'minutes ' , 'seconds ' )
242+ [ 'years ' , 'months ' , 'weeks ' , 'hours ' , 'minutes ' , 'seconds ' ]
243243 );
244- $ input = array (
244+ $ input = [
245245 'years ' => '1 ' ,
246246 'months ' => '2 ' ,
247247 'weeks ' => '3 ' ,
248248 'hours ' => '4 ' ,
249249 'minutes ' => '5 ' ,
250250 'seconds ' => '6 ' ,
251- ) ;
251+ ] ;
252252 $ output = new \DateInterval ('P1Y2M21DT4H5M6S ' );
253253 $ this ->assertDateIntervalEquals ($ output , $ transformer ->reverseTransform ($ input ));
254254 }
255255
256256 public function testReverseTransformWithFields ()
257257 {
258- $ transformer = new DateIntervalToArrayTransformer (array ( 'years ' , 'minutes ' , 'seconds ' ) );
259- $ input = array (
258+ $ transformer = new DateIntervalToArrayTransformer ([ 'years ' , 'minutes ' , 'seconds ' ] );
259+ $ input = [
260260 'years ' => '1 ' ,
261261 'minutes ' => '5 ' ,
262262 'seconds ' => '6 ' ,
263- ) ;
263+ ] ;
264264 $ output = new \DateInterval ('P1Y0M0DT0H5M6S ' );
265265 $ this ->assertDateIntervalEquals ($ output , $ transformer ->reverseTransform ($ input ));
266266 }
267267
268268 public function testBothTransformsWithWeek ()
269269 {
270270 $ transformer = new DateIntervalToArrayTransformer (
271- array ( 'years ' , 'months ' , 'weeks ' , 'hours ' , 'minutes ' , 'seconds ' )
271+ [ 'years ' , 'months ' , 'weeks ' , 'hours ' , 'minutes ' , 'seconds ' ]
272272 );
273273 $ interval = new \DateInterval ('P1Y2M21DT4H5M6S ' );
274- $ array = array (
274+ $ array = [
275275 'years ' => '1 ' ,
276276 'months ' => '2 ' ,
277277 'weeks ' => '3 ' ,
278278 'hours ' => '4 ' ,
279279 'minutes ' => '5 ' ,
280280 'seconds ' => '6 ' ,
281- ) ;
281+ ] ;
282282 $ input = $ transformer ->transform ($ interval );
283283 ksort ($ input );
284284 ksort ($ array );
0 commit comments