Skip to content

Commit 9427e98

Browse files
committed
PHPStan: Add DocComments and ignore lines that purposefully fail static analysis
1 parent 3f8000e commit 9427e98

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/HttpClient/HttpPluginClientBuilder.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class HttpPluginClientBuilder
2727
private $pluginClient;
2828
/** @var RequestFactory|RequestFactoryInterface */
2929
private $requestFactory;
30+
/** @var StreamFactoryInterface */
3031
private $streamFactory;
3132
/** @var Plugin[] */
3233
private $plugins = [];
@@ -73,7 +74,7 @@ public function addPlugin(Plugin $plugin)
7374
}
7475

7576
/**
76-
* @param string $pluginClass
77+
* @param class-string $pluginClass
7778
*/
7879
public function removePlugin($pluginClass)
7980
{

tests/HttpClient/HttpPluginClientBuilderTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function testInvalidRequestFactory(): void
2626
{
2727
$this->expectException(\TypeError::class);
2828
$definitelyNotARequestFactory = new \stdClass;
29+
/** @phpstan-ignore-next-line We are passing in an invalid type on purpose. */
2930
new HttpPluginClientBuilder(new MockClient, $definitelyNotARequestFactory);
3031
}
3132

@@ -72,7 +73,9 @@ public function matches(RequestInterface $request): bool
7273
public static function provideRequestFactories(): iterable
7374
{
7475
yield [null];
76+
// Http\Message\RequestFactory
7577
yield [new GuzzleMessageFactory];
78+
// Psr\Http\Message\RequestFactoryInterface
7679
yield [new HttpFactory];
7780
}
7881
}

0 commit comments

Comments
 (0)