Make ReflectionMethod->getClosure() always return Closure for newer version of PHP

This commit is contained in:
Alexander Lisachenko 2024-03-29 22:36:51 +02:00 committed by Ivan Fedorov
parent b0e6812884
commit af5c627e87
1 changed files with 4 additions and 2 deletions

View File

@ -189,8 +189,10 @@ class ReflectionMethod extends ReflectionFunctionAbstract
* 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]