From ec844556dca08baaf21c03b7cf88027c997d349b Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Fri, 13 Feb 2026 14:21:10 -0600 Subject: [PATCH] Verify the return of class_implements() --- src/Assert.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Assert.php b/src/Assert.php index f82ee5b..c87fbf4 100644 --- a/src/Assert.php +++ b/src/Assert.php @@ -1740,7 +1740,11 @@ public static function implementsInterface(mixed $value, mixed $interface, strin { static::objectish($value); - if (!\in_array($interface, \class_implements($value), true)) { + $implements = \class_implements($value); + + static::isArray($implements); + + if (!\in_array($interface, $implements, true)) { static::reportInvalidArgument(\sprintf( $message ?: 'Expected an implementation of %2$s. Got: %s', static::valueToString($value),