Skip to content

Commit 559659a

Browse files
committed
phpstan level 4
1 parent 0ea6844 commit 559659a

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

Diff for: .github/workflows/static.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88

99
jobs:
1010
phpstan-src:
11-
name: PHPStan src
11+
name: PHPStan
1212
runs-on: ubuntu-latest
1313

1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

1818
- name: Pull in optional dependencies
19-
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2 symfony/process phpstan/phpstan-mockery
19+
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2 symfony/process mockery/mockery phpstan/phpstan-mockery
2020

2121
- name: Cache Vendor
2222
id: cache-vendor

Diff for: phpstan.neon.dist

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ parameters:
44
- src
55
- tests
66

7-
includes:
8-
- vendor/phpstan/phpstan-mockery/extension.neon
7+
treatPhpDocTypesAsCertain: false

Diff for: src/ProxyClient/MultiplexerClient.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function clear(): static
133133
* Invoke the given $method on all available ProxyClients implementing the
134134
* given $interface.
135135
*
136-
* @param string $interface The FQN of the interface
136+
* @param class-string $interface The FQN of the interface
137137
* @param string $method The method to invoke
138138
* @param array<mixed> $arguments The arguments to be passed to the method
139139
*/
@@ -155,7 +155,9 @@ private function getProxyClients(string $interface): array
155155
{
156156
return array_filter(
157157
$this->proxyClients,
158-
static function ($proxyClient) use ($interface) {
158+
static function (ProxyClient $proxyClient) use ($interface) {
159+
// https://github.com/phpstan/phpstan/issues/8464
160+
// @phpstan-ignore-next-line
159161
return is_subclass_of($proxyClient, $interface);
160162
}
161163
);

Diff for: src/Test/WebServerSubscriber.php

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ private function hasTestsWithGroup(TestSuite $testSuite, string $group): bool
5252
continue;
5353
}
5454

55-
assert($test instanceof TestMethod);
56-
5755
foreach ($test->metadata()->isGroup() as $testGroup) {
5856
assert($testGroup instanceof Group);
5957

Diff for: tests/Functional/ProxyClient/NginxProxyClientTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testPurgeContentType(): void
3535
{
3636
$this->markTestSkipped('Not working with nginx, it can only purge one type');
3737

38-
$this->assertPurgeContentType($this->getProxyClient());
38+
// $this->assertPurgeContentType($this->getProxyClient());
3939
}
4040

4141
public function testPurgeSeparateLocationHost(): void
@@ -57,6 +57,6 @@ public function testRefreshContentType(): void
5757
{
5858
$this->markTestSkipped('TODO: is nginx mixing up variants?');
5959

60-
$this->assertRefreshContentType($this->getProxyClient());
60+
// $this->assertRefreshContentType($this->getProxyClient());
6161
}
6262
}

Diff for: tests/Unit/SymfonyCache/KernelDispatcherTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public function testFlush(): void
3333
->with($this->callback(function (Request $request) {
3434
// Test if the Symfony request contains the relevant information
3535
// from the PSR-7 request
36-
$valid = true;
37-
$valid = $valid && 'PURGETAGS' === $request->getMethod();
36+
$valid = 'PURGETAGS' === $request->getMethod();
3837
$valid = $valid && 'foobar' === $request->headers->get('content-type');
3938
$valid = $valid && 'foo,bar,stuff' === $request->headers->get('x-cache-tags');
4039
$valid = $valid && ['query' => 'string', 'more' => 'stuff'] === $request->query->all();

0 commit comments

Comments
 (0)