Skip to content

Commit 64c7222

Browse files
committed
Remove unneeded illuminate/collections + update docs
1 parent d3fe2e7 commit 64c7222

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: src/Arrays/Arr.php

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace StellarWP\Arrays;
44

55
use ArrayAccess;
6+
use Closure;
67
use InvalidArgumentException;
78

89
/**
@@ -1458,4 +1459,18 @@ public static function intersect_key_recursive( array $array, array ...$arrays )
14581459

14591460
return $array;
14601461
}
1462+
1463+
/**
1464+
* Return the default value of the given value.
1465+
*
1466+
* @template TValue
1467+
* @template TArgs
1468+
*
1469+
* @param TValue|\Closure(TArgs): TValue $value
1470+
* @param TArgs ...$args
1471+
* @return TValue
1472+
*/
1473+
private static function value( $value, ...$args ) {
1474+
return $value instanceof Closure ? $value( ...$args ) : $value;
1475+
}
14611476
}

0 commit comments

Comments
 (0)