packagist psalm/plugin-laravel v4.22.2

latest release: v4.22.3
2 hours ago

Type precision for array helpers, higher-order collection grouping and the remember_token column.

Fixes

  • Type Arr::map() and Arr::mapWithKeys() results from the callback instead of array<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 groupBy and keyBy ($users->groupBy->active) as int when the grouped value is a bool, int or int-backed enum, like the groupBy('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_token column from $table->rememberToken() as string|null: Laravel always creates it nullable (#2343)
 $token = $user->remember_token;
-// string
+// string|null

Full Changelog: v4.22.1...v4.22.2

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.