Skip to content

Commit 09979e6

Browse files
Added extra type information to help phpstan
1 parent f62596a commit 09979e6

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/Exception/HttpClientNoMatchException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*/
1515
final class HttpClientNoMatchException extends TransferException
1616
{
17+
/**
18+
* @var RequestInterface
19+
*/
1720
private $request;
1821

1922
public function __construct(string $message, RequestInterface $request, \Exception $previous = null)

src/HttpClientRouter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
final class HttpClientRouter implements HttpClientRouterInterface
2020
{
2121
/**
22-
* @var array
22+
* @var (array{matcher: RequestMatcher, client: FlexibleHttpClient})[]
2323
*/
2424
private $clients = [];
2525

@@ -60,10 +60,8 @@ public function addClient($client, RequestMatcher $requestMatcher): void
6060

6161
/**
6262
* Choose an HTTP client given a specific request.
63-
*
64-
* @return ClientInterface|HttpAsyncClient
6563
*/
66-
private function chooseHttpClient(RequestInterface $request)
64+
private function chooseHttpClient(RequestInterface $request): FlexibleHttpClient
6765
{
6866
foreach ($this->clients as $client) {
6967
if ($client['matcher']->matches($request)) {

src/Plugin/SeekableBodyPlugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@
1212
*/
1313
abstract class SeekableBodyPlugin implements Plugin
1414
{
15+
/**
16+
* @var bool
17+
*/
1518
protected $useFileBuffer;
1619

20+
/**
21+
* @var int
22+
*/
1723
protected $memoryBufferSize;
1824

1925
/**

src/PluginClientBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function addPlugin(Plugin $plugin, int $priority = 0): self
3030
return $this;
3131
}
3232

33+
/**
34+
* @param mixed $value
35+
*/
3336
public function setOption(string $name, $value): self
3437
{
3538
$this->options[$name] = $value;

0 commit comments

Comments
 (0)