From 7f8279cbec795d79d5ebf18be260828e57e128f2 Mon Sep 17 00:00:00 2001 From: Tomas Date: Fri, 18 Aug 2023 12:17:05 +0300 Subject: [PATCH] [LiveComponent] Add missing typehints to HydrationExtensionInterface I have a custom hydration extension that in `supports` method checks if the provided class has my custom marker attribute through Reflection, but SA complains: > Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string|T of object, string given. --- .../src/Hydration/HydrationExtensionInterface.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/LiveComponent/src/Hydration/HydrationExtensionInterface.php b/src/LiveComponent/src/Hydration/HydrationExtensionInterface.php index 9b7b0202243..3a62a6c9baa 100644 --- a/src/LiveComponent/src/Hydration/HydrationExtensionInterface.php +++ b/src/LiveComponent/src/Hydration/HydrationExtensionInterface.php @@ -13,8 +13,14 @@ interface HydrationExtensionInterface { + /** + * @param class-string $className + */ public function supports(string $className): bool; + /** + * @param class-string $className + */ public function hydrate(mixed $value, string $className): ?object; /**