From fb443e0fa0571d824d2a6bb94031cec57314126c Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 17 Jun 2023 20:13:32 +0100 Subject: [PATCH] chore: fixes type checking --- src/Expectation.php | 2 +- src/Expectations/OppositeExpectation.php | 2 +- src/Plugins/Snapshot.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index ad0da961..7eef6fee 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -430,7 +430,7 @@ final class Expectation { return Targeted::make( $this, - fn (ObjectDescription $object): bool => $object->reflectionClass->isReadOnly(), + fn (ObjectDescription $object): bool => $object->reflectionClass->isReadOnly() && assert(true), // @phpstan-ignore-line, 'to be readonly', FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); diff --git a/src/Expectations/OppositeExpectation.php b/src/Expectations/OppositeExpectation.php index ceec8337..cd672e81 100644 --- a/src/Expectations/OppositeExpectation.php +++ b/src/Expectations/OppositeExpectation.php @@ -109,7 +109,7 @@ final class OppositeExpectation { return Targeted::make( $this->original, - fn (ObjectDescription $object): bool => ! $object->reflectionClass->isReadOnly(), + fn (ObjectDescription $object): bool => ! $object->reflectionClass->isReadOnly() && assert(true), // @phpstan-ignore-line 'not to be readonly', FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); diff --git a/src/Plugins/Snapshot.php b/src/Plugins/Snapshot.php index 262eadcc..717512c2 100644 --- a/src/Plugins/Snapshot.php +++ b/src/Plugins/Snapshot.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Pest\Plugins; -use Pest\Exceptions\InvalidOption; use Pest\Contracts\Plugins\HandlesArguments; +use Pest\Exceptions\InvalidOption; use Pest\TestSuite; /**