1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 09:57:51 +01:00

Increase psalm error level to level 4

This commit is contained in:
Niklas Keller 2020-03-28 20:27:42 +01:00
parent 603ce25299
commit 0e04422dcb
7 changed files with 9 additions and 4 deletions

View File

@ -33,7 +33,6 @@ final class Coroutine implements Promise
try {
if (\is_array($yielded)) {
/** @var array<array-key, Promise|ReactPromise> $yielded */
return Promise\all($yielded);
}

View File

@ -7,7 +7,8 @@ use React\Promise\PromiseInterface as ReactPromise;
/**
* Creates a failed promise using the given exception.
*
* @template-implements Promise<?>
* @template-covariant TValue
* @template-implements Promise<TValue>
*/
final class Failure implements Promise
{

View File

@ -70,9 +70,11 @@ trait Placeholder
}
if (!$this->onResolved instanceof ResolutionQueue) {
/** @psalm-suppress InternalClass */
$this->onResolved = new ResolutionQueue($this->onResolved);
}
/** @psalm-suppress InternalMethod */
$this->onResolved->push($onResolved);
}

View File

@ -11,7 +11,7 @@ use React\Promise\PromiseInterface as ReactPromise;
* Stores a set of functions to be invoked when a promise is resolved.
*
* @internal
* @psalm-internal Amp
* @psalm-internal Amp\Internal
*/
class ResolutionQueue
{

View File

@ -134,6 +134,7 @@ abstract class Driver
}
}
/** @psalm-suppress RedundantCondition */
$this->dispatch(empty($this->nextTickQueue) && empty($this->enableQueue) && $this->running && !$this->isEmpty());
}

View File

@ -171,6 +171,7 @@ class UvDriver extends Driver
*/
public function now(): int
{
/** @psalm-suppress TooManyArguments */
return \uv_now($this->handle);
}
@ -187,6 +188,7 @@ class UvDriver extends Driver
*/
protected function dispatch(bool $blocking)
{
/** @psalm-suppress TooManyArguments */
\uv_run($this->handle, $blocking ? \UV::RUN_ONCE : \UV::RUN_NOWAIT);
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
errorLevel="5"
errorLevel="4"
phpVersion="7.0"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"