Type precision for array helpers, higher-order collection grouping and the remember_token column.
Fixes
- Type
Arr::map()andArr::mapWithKeys()results from the callback instead ofarray<array-key, mixed>(#2349)
/** @var array<string, int> $prices */
$cents = Arr::map($prices, fn (int $price, string $sku): float => $price / 100);
-// array<array-key, mixed>, then MixedReturnTypeCoercion / MixedArgumentTypeCoercion downstream
+// array<string, float>- Type the outer key of higher-order
groupByandkeyBy($users->groupBy->active) asintwhen the grouped value is abool,intor int-backed enum, like thegroupBy('active')form already does (#2344)
$byActive = $users->groupBy->active; // active: bool
-// Collection<array-key, Collection<int, User>>
+// Collection<int, Collection<int, User>>- Type the
remember_tokencolumn from$table->rememberToken()asstring|null: Laravel always creates it nullable (#2343)
$token = $user->remember_token;
-// string
+// string|nullFull Changelog: v4.22.1...v4.22.2