From 66d47e4922b1c44f6f991f757ddc8b8c147b6201 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 25 Sep 2021 09:39:17 +0100 Subject: [PATCH] fix: usage on PHP 7.3 --- src/Expectation.php | 8 ++++---- src/PendingObjects/TestCall.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index b229416a..a973c760 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -236,8 +236,8 @@ final class Expectation { $condition = is_callable($condition) ? $condition - : static function () use ($condition): mixed { - return $condition; + : static function () use ($condition): bool { + return (bool) $condition; // @phpstan-ignore-line }; return $this->when(!$condition(), $callback); @@ -253,8 +253,8 @@ final class Expectation { $condition = is_callable($condition) ? $condition - : static function () use ($condition): mixed { - return $condition; + : static function () use ($condition): bool { + return (bool) $condition; // @phpstan-ignore-line }; if ($condition()) { diff --git a/src/PendingObjects/TestCall.php b/src/PendingObjects/TestCall.php index 287ca7a9..88928876 100644 --- a/src/PendingObjects/TestCall.php +++ b/src/PendingObjects/TestCall.php @@ -87,8 +87,8 @@ final class TestCall { $condition = is_callable($condition) ? $condition - : static function () use ($condition): mixed { - return $condition; + : static function () use ($condition): bool { + return (bool) $condition; // @phpstan-ignore-line }; if ($condition()) {