diff --git a/composer.json b/composer.json index e703b8bd..d2500b3b 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "require-dev": { "amphp/php-cs-fixer-config": "^2", "phpunit/phpunit": "^9", - "psalm/phar": "^5.18" + "psalm/phar": "5.23.1" }, "autoload": { "psr-4": { diff --git a/src/Future/UnhandledFutureError.php b/src/Future/UnhandledFutureError.php index 8cfc927d..1c6e04c9 100644 --- a/src/Future/UnhandledFutureError.php +++ b/src/Future/UnhandledFutureError.php @@ -13,7 +13,7 @@ public function __construct(\Throwable $previous, ?string $origin = null) . '"; Await the Future with Future::await() before the future is destroyed or use ' . 'Future::ignore() to suppress this exception.'; - if ($origin) { + if ($origin !== null) { $message .= ' The future has been created at ' . $origin; } else { $message .= ' Enable assertions and set AMP_DEBUG=true in the process environment to track its origin.'; diff --git a/src/Internal/functions.php b/src/Internal/functions.php index 00dca1b2..2ebed1a5 100644 --- a/src/Internal/functions.php +++ b/src/Internal/functions.php @@ -44,6 +44,7 @@ function formatStacktrace(array $trace): string */ function isDebugEnabled(): bool { + /** @psalm-suppress RiskyTruthyFalsyComparison */ $env = \getenv("AMP_DEBUG") ?: "0"; return match ($env) { "0", "false", "off" => false,