From af5c627e87eb7aa8e9f75cfb1052ca996ec385ea Mon Sep 17 00:00:00 2001 From: Alexander Lisachenko <640114+lisachenko@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:36:51 +0200 Subject: [PATCH] Make ReflectionMethod->getClosure() always return Closure for newer version of PHP --- Reflection/ReflectionMethod.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Reflection/ReflectionMethod.php b/Reflection/ReflectionMethod.php index 72da0035b..1679b0e9b 100644 --- a/Reflection/ReflectionMethod.php +++ b/Reflection/ReflectionMethod.php @@ -189,8 +189,10 @@ public function isDestructor(): bool {} * Returns a dynamically created closure for the method * * @link https://php.net/manual/en/reflectionmethod.getclosure.php - * @param object $object Forbidden for static methods, required for other methods or nothing. - * @return Closure|null Returns {@see Closure} or {@see null} in case of an error. + * @param object|null $object Forbidden for static methods, required for other methods or nothing. + * @return Closure Returns the newly created {@see Closure}. + * @throws ValueError if object is null but the method is non-static. + * @throws ReflectionException if object is not an instance of the class this method was declared in. * @since 5.4 */ #[Pure]