Skip to content

Commit

Permalink
phpstan level 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 2, 2025
1 parent c5e8e22 commit 919509c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"php-http/discovery": "^1.12",
"php-http/async-client-implementation": "^1.1.0 || ^2.0",
"psr/http-client-implementation": "^1.0 || ^2.0",
"psr/http-factory": "^1.0"
"psr/http-factory": "^1.0",
"toflar/psr6-symfony-http-cache-store": "^4.2"
},
"require-dev": {
"mockery/mockery": "^1.6.0",
Expand All @@ -37,7 +38,8 @@
"php-http/mock-client": "^1.6.0",
"symfony/process": "^6.4|| ^7.0",
"symfony/http-kernel": "^6.4|| ^7.0",
"phpunit/phpunit": "^10.5"
"phpunit/phpunit": "^10.5",
"http-interop/http-factory-guzzle": "^0.1.0"
},
"conflict": {
"toflar/psr6-symfony-http-cache-store": "<2.2.1"
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
level: 1
level: 2
paths:
- src

2 changes: 1 addition & 1 deletion src/SymfonyCache/PurgeTagsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function handlePurgeTags(CacheEvent $event): void
if (1 === $reflection->getMethod('all')->getNumberOfParameters()) {
$headers = $request->headers->all($this->tagsHeader);
} else {
$headers = $request->headers->get($this->tagsHeader, '', false);
$headers = $request->headers->get($this->tagsHeader, '');
}

$tags = $this->tagsParser->parseTagsHeaderValue($headers);
Expand Down
4 changes: 4 additions & 0 deletions src/Test/EventDispatchingHttpCacheTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public function testPreStoreResponseNoStore()
$httpCache = $this->getHttpCachePartialMock();
$testListener = new TestListener($this, $httpCache, $request);
$testListener->preStoreResponse = $preStoreResponse;
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
$httpCache->addSubscriber($testListener);

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

$httpCache = $this->getHttpCachePartialMock(['pass']);
$testListener = new TestListener($this, $httpCache, $request);
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
$httpCache->addSubscriber($testListener);
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
$httpCache
Expand Down Expand Up @@ -307,6 +309,7 @@ public function testPreInvalidateReturnEarly(): void
$httpCache = $this->getHttpCachePartialMock(['pass']);
$testListener = new TestListener($this, $httpCache, $request);
$testListener->preInvalidateResponse = $response;
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
$httpCache->addSubscriber($testListener);
$this->assertTrue(method_exists($httpCache, 'addSubscriber'));
$httpCache
Expand All @@ -327,6 +330,7 @@ public function testAddListener(): void

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

$httpCache
Expand Down

0 comments on commit 919509c

Please sign in to comment.