This release requires Psalm 7.5. It adapts the plugin to Psalm 7.4 and 7.5, and fixes several false positives in Eloquent, Collection and migration analysis.
Requirements
- Require
vimeo/psalm^7.5.0(was^7.3.1) andpsalm/psalm-plugin-api^0.4.3(#2300)
Fixes
- Stop analyzing Blade templates as plain PHP on Psalm 7.4+. A raw
<?phpblock no longer reports every issue twice, and@psalm-suppressinside it stays local again (#2305)
<?php strlen([4]); ?>
-// InvalidArgument (reported twice for the same template line)
+// InvalidArgument (reported once)- Stop reporting
CliOnlyCallin migration files androutes/console.php(#2300)
return new class () extends Migration {
-// CliOnlyCall
public function up(): void {}
};- Support models with
@mixin \Eloquent(written by laravel-ide-helperide-helper:models --write) or another own@mixin: builder calls resolve again (#2301)
/** @mixin \Eloquent */
final class Post extends Model {}
Post::where('id', 1);
-// UndefinedMagicMethod: Magic method Post::where does not exist
+// Builder<Post>- Fix false
ArgumentTypeCoercionon EloquentBuilder::tap()with a callback typed to the concrete model or an invokable scope object (#2290) - Resolve
#[UseEloquentBuilder]inherited from a parent class or a used trait, so queries get the custom builder (#2287) - Keep
Tfor$class::query()(class-string<T>) and$model->newQuery()(T) on models with a custom builder, instead ofCustomBuilder<Model&static>; a valid@return Builder<T>no longer reportsInvalidReturnStatement(#2285) - Keep
TValueinCollection::first()andCollection::get()results when the default is a Closure (#2283)
/** @var Collection<int, User> $users */
$users->first(null, fn () => 1);
-// 1
+// 1|User- Honor
Schema::morphUsingUuids()andmorphUsingUlids()formorphs()andnullableMorphs()columns: the*_idcolumn isstringinstead ofint(#2284) - Drop every column of a variadic
dropColumn('a', 'b')and stop treatingdropVectorIndex()as a column in the migration schema (#2288) - Stop reporting constructors of events that use
Illuminate\Foundation\Events\Dispatchableas unused (#2277) - Suppress
MissingConstructoron Livewire and Volt components, whose properties are set inmount()or restored from the snapshot (#2276)
Full Changelog: v4.19.5...v4.20.0