v4.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
mixedwhen 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 becamemixedwith no issue reported. Affected classes includedEvents\Dispatcher,Http\Client\PendingRequest,Http\Client\Response,FormRequest,Pipeline, and several facades (#1616, #1618)
app('events')->hasListeners('order.shipped');
-// mixed
+// bool- Type
Artisan::all()andConsole\Kernel::all()(contract and concrete) asarray<array-key, Command>instead ofarray(#1612)
$commands = Artisan::all();
-// array<array-key, mixed>
+// array<array-key, Symfony\Component\Console\Command\Command>- Type
DB::getQueryLog()entries andSchema::getColumnListing()with the shapesConnectionandSchema\Builderalready document, instead of the facades' plainarray(#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) onEvents\Dispatcher, its contract, and theEventfacade asmixed: it returns the first non-null listener response, notarray|null(#1612) - Type
MailMessageproperties ($viewnullable;$from,$replyTo,$attachments,$rawAttachmentswith the shapesMailChannelaccepts),MailMessage::render()asHtmlString|string, andNotification::$idasstring|null(#1612) - Accept an Eloquent
Collectionof related models inBelongsToMany::saveMany()andsaveManyQuietly(), and keep its type on return (#1612) - Type
Reflector::getParameterClassNames()aslist<string>,Route::methods()asarray<string>, acceptnullinMigrator::usingConnection(), and markUrlGenerator's resolver, formatter, and forced root/scheme properties nullable (#1612)
Full Changelog: v4.16.5...v4.16.6