diff --git a/composer.json b/composer.json index 18e66e7..c69c780 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "ext-json": "*", "phpunit/phpunit": "^9", "jetbrains/phpstorm-stubs": "^2019.3", - "psalm/phar": "^4.7" + "psalm/phar": "^5" }, "autoload": { "psr-4": { diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 0000000..9aed453 --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,43 @@ + + + + + signals]]> + signals]]> + + + + + signals]]> + signals]]> + + + + + (int) ($timeout * 1_000_000) + + + + + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) + + + + + handle, $callback->stream)]]> + handle)]]> + signalCallback, $callback->signal)]]> + + + + + stopped]]> + + + diff --git a/psalm.xml b/psalm.xml index 7c63f8b..42fe89f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + errorBaseline="psalm-baseline.xml" > diff --git a/src/EventLoop.php b/src/EventLoop.php index 347f588..1b81136 100644 --- a/src/EventLoop.php +++ b/src/EventLoop.php @@ -346,7 +346,7 @@ public static function getType(string $callbackId): CallbackType * * @param string $callbackId The callback identifier. * - * @return bool {@code true} if the callback is currently enabled, otherwise {@code false}. + * @return bool `true` if the callback is currently enabled, otherwise `false`. */ public static function isEnabled(string $callbackId): bool { @@ -358,7 +358,7 @@ public static function isEnabled(string $callbackId): bool * * @param string $callbackId The callback identifier. * - * @return bool {@code true} if the callback is currently referenced, otherwise {@code false}. + * @return bool `true` if the callback is currently referenced, otherwise `false`. */ public static function isReferenced(string $callbackId): bool { diff --git a/src/EventLoop/Driver.php b/src/EventLoop/Driver.php index 84e5e8a..80464aa 100644 --- a/src/EventLoop/Driver.php +++ b/src/EventLoop/Driver.php @@ -294,7 +294,7 @@ public function getType(string $callbackId): CallbackType; * * @param string $callbackId The callback identifier. * - * @return bool {@code true} if the callback is currently enabled, otherwise {@code false}. + * @return bool `true` if the callback is currently enabled, otherwise `false`. */ public function isEnabled(string $callbackId): bool; @@ -303,7 +303,7 @@ public function isEnabled(string $callbackId): bool; * * @param string $callbackId The callback identifier. * - * @return bool {@code true} if the callback is currently referenced, otherwise {@code false}. + * @return bool `true` if the callback is currently referenced, otherwise `false`. */ public function isReferenced(string $callbackId): bool; diff --git a/src/EventLoop/Internal/DriverSuspension.php b/src/EventLoop/Internal/DriverSuspension.php index e798aae..3388d89 100644 --- a/src/EventLoop/Internal/DriverSuspension.php +++ b/src/EventLoop/Internal/DriverSuspension.php @@ -71,6 +71,7 @@ public function suspend(): mixed { // Throw exception when trying to use old dead {main} suspension if ($this->deadMain) { + \assert($this->error !== null); throw $this->error; } if ($this->pending) {