Skip to content

Commit 7dcd804

Browse files
authored
Merge pull request #55 from php-http/short-arrays
spec is not analyzed by styleci - but we should use short array syntax
2 parents 8e2505d + 511f2d3 commit 7dcd804

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

spec/CachePluginSpec.php

Lines changed: 16 additions & 16 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);
@@ -184,10 +184,10 @@ function it_calculate_age_from_response(CacheItemPoolInterface $pool, CacheItemI
184184

185185
$response->getStatusCode()->willReturn(200);
186186
$response->getBody()->willReturn($stream);
187-
$response->getHeader('Cache-Control')->willReturn(array('max-age=40'));
188-
$response->getHeader('Age')->willReturn(array('15'));
189-
$response->getHeader('Expires')->willReturn(array());
190-
$response->getHeader('ETag')->willReturn(array());
187+
$response->getHeader('Cache-Control')->willReturn(['max-age=40']);
188+
$response->getHeader('Age')->willReturn(['15']);
189+
$response->getHeader('Expires')->willReturn([]);
190+
$response->getHeader('ETag')->willReturn([]);
191191

192192
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
193193
$item->isHit()->willReturn(false);
@@ -222,9 +222,9 @@ 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());
227-
$response->getHeader('ETag')->willReturn(array('foo_etag'));
225+
$response->getHeader('Cache-Control')->willReturn([]);
226+
$response->getHeader('Expires')->willReturn([]);
227+
$response->getHeader('ETag')->willReturn(['foo_etag']);
228228

229229
$pool->getItem('d20f64acc6e70b6079845f2fe357732929550ae1')->shouldBeCalled()->willReturn($item);
230230
$item->isHit()->willReturn(false);
@@ -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)