packagist psalm/plugin-laravel v3.14.11

one day ago

Collection type inference for arbitrary inputs, and partial Laravel boots now surface instead of failing silently, plus three false-positive fixes around query builders and monorepo init already shipped on the 4.x line.

This release bumps min supported Laravel minor versions:

  • ^12.4 to ^12.14
  • ^13.0 to ^13.3

Features

  • Infer collect(), Collection::make(), and LazyCollection::make() return types for arbitrary inputs, not just arrays (#1225)
 collect('hello');
-// InvalidArgument (before): string wasn't Arrayable|iterable|null
+// now infers: Collection<0, 'hello'>

 collect(BackedSuit::Hearts);
-// InvalidArgument (before): enum cases weren't accepted either
+// now infers: Collection<0, BackedSuit>

 collect(null);
-// before: Collection<array-key, mixed> (unbound fallback)
+// now infers: Collection<never, never>

Fixes

  • Fix false UndefinedMagicMethod on custom Eloquent builder subclass methods called after a fluent chain (#1219)
  • Fix false UndefinedMagicMethod on IndexDefinition modifiers in database migrations (#1220)
  • Fix psalm-laravel init on monorepos: no longer puts packages/ into <ignoreFiles>, which silently disabled analysis of package sources (#1214)
  • Surface swallowed bootstrap() failures: a partial Laravel boot now emits a warning by default, and fails the run under failOnInternalError (#1226)

Full Changelog: v3.14.10...v3.14.11

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.