Skip to content

Commit abb664e

Browse files
committed
refactor: make method names shorter
1 parent 775ded8 commit abb664e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

system/Helpers/Array/ArrayHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class ArrayHelper
2222
*
2323
* @return array|bool|int|object|string|null
2424
*/
25-
public static function dotArraySearch(string $index, array $array)
25+
public static function dotSearch(string $index, array $array)
2626
{
2727
// See https://regex101.com/r/44Ipql/1
2828
$segments = preg_split(
@@ -107,7 +107,7 @@ private static function arraySearchDot(array $indexes, array $array)
107107
*
108108
* @return array Result array where rows are grouped together by indexes values.
109109
*/
110-
public static function arrayGroupBy(array $array, array $indexes, bool $includeEmpty = false): array
110+
public static function groupBy(array $array, array $indexes, bool $includeEmpty = false): array
111111
{
112112
if ($indexes === []) {
113113
return $array;

system/Helpers/array_helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
function dot_array_search(string $index, array $array)
2424
{
25-
return ArrayHelper::dotArraySearch($index, $array);
25+
return ArrayHelper::dotSearch($index, $array);
2626
}
2727
}
2828

@@ -158,6 +158,6 @@ function array_flatten_with_dots(iterable $array, string $id = ''): array
158158
*/
159159
function array_group_by(array $array, array $indexes, bool $includeEmpty = false): array
160160
{
161-
return ArrayHelper::arrayGroupBy($array, $indexes, $includeEmpty);
161+
return ArrayHelper::groupBy($array, $indexes, $includeEmpty);
162162
}
163163
}

0 commit comments

Comments
 (0)