1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the "andrey-helldar/support" project. |
5
|
|
|
* |
6
|
|
|
* For the full copyright and license information, please view the LICENSE |
7
|
|
|
* file that was distributed with this source code. |
8
|
|
|
* |
9
|
|
|
* @author Andrey Helldar <[email protected]> |
10
|
|
|
* |
11
|
|
|
* @copyright 2021 Andrey Helldar |
12
|
|
|
* |
13
|
|
|
* @license MIT |
14
|
|
|
* |
15
|
|
|
* @see https://github.com/andrey-helldar/support |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
namespace Helldar\Support\Facades\Helpers; |
19
|
|
|
|
20
|
|
|
use ArrayAccess; |
21
|
|
|
use Helldar\Support\Facades\Facade; |
22
|
|
|
use Helldar\Support\Helpers\Arr as Helper; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @method static array addUnique(array $array, $values) |
26
|
|
|
* @method static array except(array $array, array|callable|string $keys) |
27
|
|
|
* @method static array filter($array, callable $callback = null, int $mode = 0) |
28
|
|
|
* @method static array flatten(array $array, bool $ignore_keys = true) |
29
|
|
|
* @method static array flattenKeys($array, string $delimiter = '.') |
30
|
|
|
* @method static array flip($array) |
31
|
|
|
* @method static array keys($array) |
32
|
|
|
* @method static array ksort(array $array, callable $callback = null) |
33
|
|
|
* @method static array map(array|ArrayAccess $array, callable $callback, bool $recursive = false) |
34
|
|
|
* @method static array merge(...$arrays) |
35
|
|
|
* @method static array only(array|ArrayAccess $array, array|callable|string $keys) |
36
|
|
|
* @method static array push(array|ArrayAccess $array, mixed ...$values) |
37
|
|
|
* @method static array remove(array|ArrayAccess $array, mixed $key) |
38
|
|
|
* @method static array renameKeys(array $array, callable $callback) |
39
|
|
|
* @method static array renameKeysMap(array $array, array $map) |
40
|
|
|
* @method static array set(array|ArrayAccess $array, array|mixed $key, mixed $value = null) |
41
|
|
|
* @method static array sort(array $array, callable $callback = null) |
42
|
|
|
* @method static array sortByKeys(array $array, array $sorter) |
43
|
|
|
* @method static array tap(array|ArrayAccess $array, callable $callback) |
44
|
|
|
* @method static array toArray($value = null) |
45
|
|
|
* @method static array unique(array $array, int $flags = SORT_STRING) |
46
|
|
|
* @method static array values($array) |
47
|
|
|
* @method static array wrap($value = null) |
48
|
|
|
* @method static bool doesntEmpty($value) |
49
|
|
|
* @method static bool exists(array|ArrayAccess $array, $key) |
50
|
|
|
* @method static bool existsWithoutDot(array|ArrayAccess $array, $key) |
51
|
|
|
* @method static bool isArrayable($value = null) |
52
|
|
|
* @method static bool isEmpty($value) |
53
|
|
|
* @method static int longestStringLength(array $array) |
54
|
|
|
* @method static mixed get(array|ArrayAccess $array, $key, $default = null) |
55
|
|
|
* @method static mixed getKey(array|ArrayAccess $array, $key, $default = null) |
56
|
|
|
* @method static void store(array|ArrayAccess $array, string $path, bool $is_json = false, bool $sort_keys = false, int $json_flags = 0) |
57
|
|
|
* @method static void storeAsArray(string $path, array|ArrayAccess $array, bool $sort_keys = false) |
58
|
|
|
* @method static void storeAsJson(string $path, array|ArrayAccess $array, bool $sort_keys = false, int $flags = 0) |
59
|
|
|
*/ |
60
|
|
|
class Arr extends Facade |
61
|
|
|
{ |
62
|
360 |
|
protected static function getFacadeAccessor() |
63
|
|
|
{ |
64
|
360 |
|
return Helper::class; |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|