@@ -23,7 +23,7 @@ final class Callback
2323 /**
2424 * Invokes internal PHP function with own error handler.
2525 * @param list<mixed> $args
26- * @param callable(string, int): ? bool $onError
26+ * @param callable(string, int): ( bool|void|null) $onError
2727 */
2828 public static function invokeSafe (string $ function , array $ args , callable $ onError ): mixed
2929 {
@@ -52,7 +52,7 @@ public static function invokeSafe(string $function, array $args, callable $onErr
5252 /**
5353 * Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies
5454 * that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists.
55- * @return callable(): mixed
55+ * @return callable
5656 * @throws Nette\InvalidArgumentException
5757 */
5858 public static function check (mixed $ callable , bool $ syntax = false ): mixed
@@ -86,7 +86,7 @@ public static function toString(mixed $callable): string
8686
8787 /**
8888 * Returns reflection for method or function used in PHP callback.
89- * @param callable(): mixed $callable type check is escalated to ReflectionException
89+ * @param callable $callable type check is escalated to ReflectionException
9090 * @throws \ReflectionException if callback is not valid
9191 */
9292 public static function toReflection ($ callable ): \ReflectionMethod |\ReflectionFunction
@@ -109,7 +109,6 @@ public static function toReflection($callable): \ReflectionMethod|\ReflectionFun
109109
110110 /**
111111 * Checks whether PHP callback is function or static method.
112- * @param callable(): mixed $callable
113112 */
114113 public static function isStatic (callable $ callable ): bool
115114 {
@@ -119,7 +118,6 @@ public static function isStatic(callable $callable): bool
119118
120119 /**
121120 * Unwraps closure created by Closure::fromCallable().
122- * @param \Closure(): mixed $closure
123121 * @return \Closure|array{object|class-string, string}|callable-string
124122 */
125123 public static function unwrap (\Closure $ closure ): callable |array
0 commit comments