Skip to content

Fix ci builds #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(static): Add PHPStan configuration.
Also fix static errors in Promise.
  • Loading branch information
shulard committed Dec 17, 2020
commit de35d3fba41c6d98cb55fb05f118736d2f76cd67
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: max
paths:
- src
9 changes: 5 additions & 4 deletions src/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ final class Promise implements HttpPromise
/**
* PSR7 received response.
*
* @var ResponseInterface
* @var ResponseInterface|null
*/
private $response;

/**
* Execution error.
*
* @var Exception
* @var HttplugException
*/
private $exception;

Expand Down Expand Up @@ -69,7 +69,7 @@ public function __construct(PromiseInterface $promise, LoopInterface $loop, Requ
$this->request = $request;
$this->loop = $loop;
$this->promise = $promise->then(
function (?ResponseInterface $response): ResponseInterface {
function (?ResponseInterface $response): ?ResponseInterface {
$this->response = $response;
$this->state = self::FULFILLED;

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

throw $this->exception;
});
}
);
}

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