From c7c389a5aef89e585e61b0c772b1c3ccf1e028d6 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Tue, 21 May 2024 13:33:20 +0700 Subject: [PATCH] Update docs --- src/ArArrayHelper.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ArArrayHelper.php b/src/ArArrayHelper.php index 779007ad8..48b82da70 100644 --- a/src/ArArrayHelper.php +++ b/src/ArArrayHelper.php @@ -18,7 +18,7 @@ * Array manipulation methods for ActiveRecord. * * @psalm-type Row = ActiveRecordInterface|array - * @psalm-type PathKey = string|Closure(Row, mixed=):mixed + * @psalm-type IndexKey = string|Closure(Row, mixed=):mixed */ final class ArArrayHelper { @@ -75,10 +75,6 @@ public static function getColumn(array $array, string $name): array * $username = ArArrayHelper::getValueByPath($array, 'username'); * // working with an {@see ActiveRecordInterface} instance * $username = ArArrayHelper::getValueByPath($user, 'username'); - * // working with an anonymous function - * $fullName = ArArrayHelper::getValueByPath($user, function ($user, $defaultValue) { - * return $user->firstName . ' ' . $user->lastName; - * }); * // using dot format to retrieve the property of an {@see ActiveRecordInterface} instance * $street = ArArrayHelper::getValue($users, 'address.street'); * ``` @@ -129,7 +125,7 @@ public static function getValueByPath(ActiveRecordInterface|array $array, string * * @psalm-template TRow of Row * @psalm-param array $rows - * @psalm-param PathKey|null $indexBy + * @psalm-param IndexKey|null $indexBy * @psalm-return array * * @return array[]