Skip to content

Commit ba8c484

Browse files
committed
spec is not analyzed by styleci - but we should use short array syntax
1 parent 8e2505d commit ba8c484

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spec/CachePluginSpec.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ function it_caches_responses(CacheItemPoolInterface $pool, CacheItemInterface $i
4646

4747
$response->getStatusCode()->willReturn(200);
4848
$response->getBody()->willReturn($stream);
49-
$response->getHeader('Cache-Control')->willReturn(array())->shouldBeCalled();
50-
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
51-
$response->getHeader('ETag')->willReturn(array())->shouldBeCalled();
49+
$response->getHeader('Cache-Control')->willReturn([])->shouldBeCalled();
50+
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();
51+
$response->getHeader('ETag')->willReturn([])->shouldBeCalled();
5252

5353
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
5454
$item->isHit()->willReturn(false);
@@ -77,8 +77,8 @@ function it_doesnt_store_failed_responses(CacheItemPoolInterface $pool, CacheIte
7777
$request->getBody()->shouldBeCalled();
7878

7979
$response->getStatusCode()->willReturn(400);
80-
$response->getHeader('Cache-Control')->willReturn(array());
81-
$response->getHeader('Expires')->willReturn(array());
80+
$response->getHeader('Cache-Control')->willReturn([]);
81+
$response->getHeader('Expires')->willReturn([]);
8282

8383
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
8484
$item->isHit()->willReturn(false);
@@ -186,8 +186,8 @@ function it_calculate_age_from_response(CacheItemPoolInterface $pool, CacheItemI
186186
$response->getBody()->willReturn($stream);
187187
$response->getHeader('Cache-Control')->willReturn(array('max-age=40'));
188188
$response->getHeader('Age')->willReturn(array('15'));
189-
$response->getHeader('Expires')->willReturn(array());
190-
$response->getHeader('ETag')->willReturn(array());
189+
$response->getHeader('Expires')->willReturn([]);
190+
$response->getHeader('ETag')->willReturn([]);
191191

192192
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
193193
$item->isHit()->willReturn(false);
@@ -222,8 +222,8 @@ function it_saves_etag(CacheItemPoolInterface $pool, CacheItemInterface $item, R
222222
$request->getUri()->willReturn('/');
223223
$response->getStatusCode()->willReturn(200);
224224
$response->getBody()->willReturn($stream);
225-
$response->getHeader('Cache-Control')->willReturn(array());
226-
$response->getHeader('Expires')->willReturn(array());
225+
$response->getHeader('Cache-Control')->willReturn([]);
226+
$response->getHeader('Expires')->willReturn([]);
227227
$response->getHeader('ETag')->willReturn(array('foo_etag'));
228228

229229
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
@@ -317,8 +317,8 @@ function it_serves_and_resaved_expired_response(CacheItemPoolInterface $pool, Ca
317317
$request->withHeader(Argument::any(), Argument::any())->willReturn($request);
318318

319319
$response->getStatusCode()->willReturn(304);
320-
$response->getHeader('Cache-Control')->willReturn(array());
321-
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
320+
$response->getHeader('Cache-Control')->willReturn([]);
321+
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();
322322

323323
// Make sure we add back the body
324324
$response->withBody($stream)->willReturn($response)->shouldBeCalled();
@@ -377,8 +377,8 @@ function it_caches_private_responses_when_allowed(
377377
$response->getStatusCode()->willReturn(200);
378378
$response->getBody()->willReturn($stream);
379379
$response->getHeader('Cache-Control')->willReturn(['private'])->shouldBeCalled();
380-
$response->getHeader('Expires')->willReturn(array())->shouldBeCalled();
381-
$response->getHeader('ETag')->willReturn(array())->shouldBeCalled();
380+
$response->getHeader('Expires')->willReturn([])->shouldBeCalled();
381+
$response->getHeader('ETag')->willReturn([])->shouldBeCalled();
382382

383383
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
384384
$item->isHit()->willReturn(false);

0 commit comments

Comments
 (0)