From f0a08f0503e77539db056230fff01fe7aa2ea4b1 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 17 Feb 2026 17:52:00 +0000 Subject: [PATCH] chore: missing types --- src/Expectation.php | 2 +- src/Expectations/OppositeExpectation.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 4d791e95..cb1a7fd3 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -864,7 +864,7 @@ final class Expectation return Targeted::make( $this, - fn (ObjectDescription $object): bool => array_all($interfaces, fn ($interface): bool => isset($object->reflectionClass) && $object->reflectionClass->implementsInterface($interface)), + fn (ObjectDescription $object): bool => array_all($interfaces, fn (string $interface): bool => isset($object->reflectionClass) && $object->reflectionClass->implementsInterface($interface)), "to implement '".implode("', '", $interfaces)."'", FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); diff --git a/src/Expectations/OppositeExpectation.php b/src/Expectations/OppositeExpectation.php index 657f0140..22162b5a 100644 --- a/src/Expectations/OppositeExpectation.php +++ b/src/Expectations/OppositeExpectation.php @@ -576,7 +576,7 @@ final readonly class OppositeExpectation return Targeted::make( $original, - fn (ObjectDescription $object): bool => array_all($traits, fn ($trait): bool => ! (isset($object->reflectionClass) && in_array($trait, $object->reflectionClass->getTraitNames(), true))), + fn (ObjectDescription $object): bool => array_all($traits, fn (string $trait): bool => ! (isset($object->reflectionClass) && in_array($trait, $object->reflectionClass->getTraitNames(), true))), "not to use traits '".implode("', '", $traits)."'", FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); @@ -596,7 +596,7 @@ final readonly class OppositeExpectation return Targeted::make( $original, - fn (ObjectDescription $object): bool => array_all($interfaces, fn ($interface): bool => ! (isset($object->reflectionClass) && $object->reflectionClass->implementsInterface($interface))), + fn (ObjectDescription $object): bool => array_all($interfaces, fn (string $interface): bool => ! (isset($object->reflectionClass) && $object->reflectionClass->implementsInterface($interface))), "not to implement '".implode("', '", $interfaces)."'", FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), );