mirror of
https://github.com/danog/amp.git
synced 2024-12-04 18:38:17 +01:00
Increase psalm error level to level 4
This commit is contained in:
parent
603ce25299
commit
0e04422dcb
@ -33,7 +33,6 @@ final class Coroutine implements Promise
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (\is_array($yielded)) {
|
if (\is_array($yielded)) {
|
||||||
/** @var array<array-key, Promise|ReactPromise> $yielded */
|
|
||||||
return Promise\all($yielded);
|
return Promise\all($yielded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@ use React\Promise\PromiseInterface as ReactPromise;
|
|||||||
/**
|
/**
|
||||||
* Creates a failed promise using the given exception.
|
* Creates a failed promise using the given exception.
|
||||||
*
|
*
|
||||||
* @template-implements Promise<?>
|
* @template-covariant TValue
|
||||||
|
* @template-implements Promise<TValue>
|
||||||
*/
|
*/
|
||||||
final class Failure implements Promise
|
final class Failure implements Promise
|
||||||
{
|
{
|
||||||
|
@ -70,9 +70,11 @@ trait Placeholder
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->onResolved instanceof ResolutionQueue) {
|
if (!$this->onResolved instanceof ResolutionQueue) {
|
||||||
|
/** @psalm-suppress InternalClass */
|
||||||
$this->onResolved = new ResolutionQueue($this->onResolved);
|
$this->onResolved = new ResolutionQueue($this->onResolved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @psalm-suppress InternalMethod */
|
||||||
$this->onResolved->push($onResolved);
|
$this->onResolved->push($onResolved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ use React\Promise\PromiseInterface as ReactPromise;
|
|||||||
* Stores a set of functions to be invoked when a promise is resolved.
|
* Stores a set of functions to be invoked when a promise is resolved.
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @psalm-internal Amp
|
* @psalm-internal Amp\Internal
|
||||||
*/
|
*/
|
||||||
class ResolutionQueue
|
class ResolutionQueue
|
||||||
{
|
{
|
||||||
|
@ -134,6 +134,7 @@ abstract class Driver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @psalm-suppress RedundantCondition */
|
||||||
$this->dispatch(empty($this->nextTickQueue) && empty($this->enableQueue) && $this->running && !$this->isEmpty());
|
$this->dispatch(empty($this->nextTickQueue) && empty($this->enableQueue) && $this->running && !$this->isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +171,7 @@ class UvDriver extends Driver
|
|||||||
*/
|
*/
|
||||||
public function now(): int
|
public function now(): int
|
||||||
{
|
{
|
||||||
|
/** @psalm-suppress TooManyArguments */
|
||||||
return \uv_now($this->handle);
|
return \uv_now($this->handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +188,7 @@ class UvDriver extends Driver
|
|||||||
*/
|
*/
|
||||||
protected function dispatch(bool $blocking)
|
protected function dispatch(bool $blocking)
|
||||||
{
|
{
|
||||||
|
/** @psalm-suppress TooManyArguments */
|
||||||
\uv_run($this->handle, $blocking ? \UV::RUN_ONCE : \UV::RUN_NOWAIT);
|
\uv_run($this->handle, $blocking ? \UV::RUN_ONCE : \UV::RUN_NOWAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<psalm
|
<psalm
|
||||||
totallyTyped="false"
|
totallyTyped="false"
|
||||||
errorLevel="5"
|
errorLevel="4"
|
||||||
phpVersion="7.0"
|
phpVersion="7.0"
|
||||||
resolveFromConfigFile="true"
|
resolveFromConfigFile="true"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
Loading…
Reference in New Issue
Block a user