Skip to content

Commit 919509c

Browse files
committed
phpstan level 2
1 parent c5e8e22 commit 919509c

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

composer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"php-http/discovery": "^1.12",
2929
"php-http/async-client-implementation": "^1.1.0 || ^2.0",
3030
"psr/http-client-implementation": "^1.0 || ^2.0",
31-
"psr/http-factory": "^1.0"
31+
"psr/http-factory": "^1.0",
32+
"toflar/psr6-symfony-http-cache-store": "^4.2"
3233
},
3334
"require-dev": {
3435
"mockery/mockery": "^1.6.0",
@@ -37,7 +38,8 @@
3738
"php-http/mock-client": "^1.6.0",
3839
"symfony/process": "^6.4|| ^7.0",
3940
"symfony/http-kernel": "^6.4|| ^7.0",
40-
"phpunit/phpunit": "^10.5"
41+
"phpunit/phpunit": "^10.5",
42+
"http-interop/http-factory-guzzle": "^0.1.0"
4143
},
4244
"conflict": {
4345
"toflar/psr6-symfony-http-cache-store": "<2.2.1"

phpstan.neon.dist

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
parameters:
2-
level: 1
2+
level: 2
33
paths:
44
- src
5+

src/SymfonyCache/PurgeTagsListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function handlePurgeTags(CacheEvent $event): void
118118
if (1 === $reflection->getMethod('all')->getNumberOfParameters()) {
119119
$headers = $request->headers->all($this->tagsHeader);
120120
} else {
121-
$headers = $request->headers->get($this->tagsHeader, '', false);
121+
$headers = $request->headers->get($this->tagsHeader, '');
122122
}
123123

124124
$tags = $this->tagsParser->parseTagsHeaderValue($headers);

src/Test/EventDispatchingHttpCacheTestCase.php

+4
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ public function testPreStoreResponseNoStore()
251251
$httpCache = $this->getHttpCachePartialMock();
252252
$testListener = new TestListener($this, $httpCache, $request);
253253
$testListener->preStoreResponse = $preStoreResponse;
254+
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
254255
$httpCache->addSubscriber($testListener);
255256

256257
$store = $this->createMock(StoreInterface::class);
@@ -279,6 +280,7 @@ public function testPreInvalidateCalled(): void
279280

280281
$httpCache = $this->getHttpCachePartialMock(['pass']);
281282
$testListener = new TestListener($this, $httpCache, $request);
283+
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
282284
$httpCache->addSubscriber($testListener);
283285
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
284286
$httpCache
@@ -307,6 +309,7 @@ public function testPreInvalidateReturnEarly(): void
307309
$httpCache = $this->getHttpCachePartialMock(['pass']);
308310
$testListener = new TestListener($this, $httpCache, $request);
309311
$testListener->preInvalidateResponse = $response;
312+
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
310313
$httpCache->addSubscriber($testListener);
311314
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
312315
$httpCache
@@ -327,6 +330,7 @@ public function testAddListener(): void
327330

328331
$httpCache = $this->getHttpCachePartialMock(['lookup']);
329332
$simpleListener = new SimpleListener($this, $httpCache, $request);
333+
$this->assertTrue(method_exists($httpCache, 'addListener'));
330334
$httpCache->addListener(Events::PRE_HANDLE, [$simpleListener, 'callback']);
331335

332336
$httpCache

0 commit comments

Comments
 (0)