We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4074a6 commit 2a2c335Copy full SHA for 2a2c335
1 file changed
src/Global/base.php
@@ -8,10 +8,10 @@
8
/**
9
* Return the default value of the given value.
10
*/
11
- function value(mixed $value, mixed ...$args): mixed
+ function value(mixed $value, mixed ...$params): mixed
12
{
13
return $value instanceof Closure || (is_object($value) && is_callable($value))
14
- ? $value(...$args)
+ ? $value(...$params)
15
: $value;
16
}
17
@@ -151,6 +151,13 @@ function isTrue(mixed $val, bool $return_null = false): ?bool
151
152
153
if (!function_exists('instance')) {
154
+ /**
155
+ * @phpstan-param T|class-string<T>|null $instance
156
+ * @param mixed ...$params
157
+ * @phpstan-return T|null
158
+ *
159
+ * @template T as object
160
+ */
161
function instance(string|object|null $instance, mixed ...$params): ?object
162
163
if (is_object($instance)) {
0 commit comments