packagist psalm/plugin-laravel v3.16.6

3 hours ago

v3.16.6 restores vendor methods on stubbed Laravel classes that silently resolved to mixed, and tightens docblock types for console, events, facades, mail, and relations.

Fixes

  • Fix unstubbed methods of a stubbed Laravel class resolving to mixed when nothing in the project named that class before the plugin's stubs loaded. Psalm then skipped the class's vendor file, so with __call (Macroable) every method the stub did not declare became mixed with no issue reported. Affected classes included Events\Dispatcher, Http\Client\PendingRequest, Http\Client\Response, FormRequest, Pipeline, and several facades (#1616, #1618)
 app('events')->hasListeners('order.shipped');
-// mixed
+// bool
  • Type Artisan::all() and Console\Kernel::all() (contract and concrete) as array<array-key, Command> instead of array (#1612)
 $commands = Artisan::all();
-// array<array-key, mixed>
+// array<array-key, Symfony\Component\Console\Command\Command>
  • Type DB::getQueryLog() entries and Schema::getColumnListing() with the shapes Connection and Schema\Builder already document, instead of the facades' plain array (#1612)
 $log = DB::getQueryLog();
-// array<array-key, mixed>
+// list<array{query: string, bindings: array<array-key, mixed>, time: float|null, readWriteType?: string|null}>
  • Type halting event dispatch (until(), dispatch() with $halt = true) on Events\Dispatcher, its contract, and the Event facade as mixed: it returns the first non-null listener response, not array|null (#1612)
  • Type MailMessage properties ($view nullable; $from, $replyTo, $attachments, $rawAttachments with the shapes MailChannel accepts), MailMessage::render() as HtmlString|string, and Notification::$id as string|null (#1612)
  • Accept an Eloquent Collection of related models in BelongsToMany::saveMany() and saveManyQuietly(), and keep its type on return (#1612)
  • Type Reflector::getParameterClassNames() as list<string>, Route::methods() as array<string>, accept null in Migrator::usingConnection(), and mark UrlGenerator's resolver, formatter, and forced root/scheme properties nullable (#1612)

Full Changelog: v3.16.4...v3.16.6

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.