Skip to content

Commit de35d3f

Browse files
committed
chore(static): Add PHPStan configuration.
Also fix static errors in Promise.
1 parent 16e7abd commit de35d3f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

phpstan.neon.dist

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: max
3+
paths:
4+
- src

src/Promise.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ final class Promise implements HttpPromise
3030
/**
3131
* PSR7 received response.
3232
*
33-
* @var ResponseInterface
33+
* @var ResponseInterface|null
3434
*/
3535
private $response;
3636

3737
/**
3838
* Execution error.
3939
*
40-
* @var Exception
40+
* @var HttplugException
4141
*/
4242
private $exception;
4343

@@ -69,7 +69,7 @@ public function __construct(PromiseInterface $promise, LoopInterface $loop, Requ
6969
$this->request = $request;
7070
$this->loop = $loop;
7171
$this->promise = $promise->then(
72-
function (?ResponseInterface $response): ResponseInterface {
72+
function (?ResponseInterface $response): ?ResponseInterface {
7373
$this->response = $response;
7474
$this->state = self::FULFILLED;
7575

@@ -92,7 +92,8 @@ function ($reason): void {
9292
}
9393

9494
throw $this->exception;
95-
});
95+
}
96+
);
9697
}
9798

9899
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)

0 commit comments

Comments
 (0)