diff options
author | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
commit | 80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch) | |
tree | 04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/thecodingmachine/safe/generated/funchand.php | |
parent | 4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff) |
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/funchand.php')
-rw-r--r-- | vendor/thecodingmachine/safe/generated/funchand.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/vendor/thecodingmachine/safe/generated/funchand.php b/vendor/thecodingmachine/safe/generated/funchand.php index 64654526e..4b2a7b8ff 100644 --- a/vendor/thecodingmachine/safe/generated/funchand.php +++ b/vendor/thecodingmachine/safe/generated/funchand.php @@ -5,12 +5,14 @@ namespace Safe; use Safe\Exceptions\FunchandException; /** - * Creates an anonymous function from the parameters passed, and - * returns a unique name for it. + * Creates a function dynamically from the parameters passed, and returns a unique name for it. * - * @param string $args The function arguments. + * @param string $args The function arguments, as a single comma-separated string. * @param string $code The function code. * @return string Returns a unique function name as a string. + * Note that the name contains a non-printable character ("\0"), + * so care should be taken when printing the name or incorporating it in any other + * string. * @throws FunchandException * */ @@ -28,18 +30,18 @@ function create_function(string $args, string $code): string /** * * - * @param callable(): void $function The function to register. - * @param mixed $params + * @param callable(): void $callback The function to register. + * @param mixed $args * @throws FunchandException * */ -function register_tick_function(callable $function, ...$params): void +function register_tick_function(callable $callback, ...$args): void { error_clear_last(); - if ($params !== []) { - $result = \register_tick_function($function, ...$params); + if ($args !== []) { + $result = \register_tick_function($callback, ...$args); } else { - $result = \register_tick_function($function); + $result = \register_tick_function($callback); } if ($result === false) { throw FunchandException::createFromPhpError(); |