This patch release lets Psalter fix OctaneIncompatibleBinding. It also fixes facade method sealing, Stringable on Carbon and collections, env() closure defaults, and plugin warnings that were hidden under --no-progress.
Features
- Let Psalter fix
OctaneIncompatibleBinding:vendor/bin/psalter --issues=OctaneIncompatibleBindingrewritessingleton()toscoped()andsingletonIf()toscopedIf()(#2261)
-$this->app->singleton(Cart::class, fn ($app) => new Cart($app->make(Request::class)));
+$this->app->scoped(Cart::class, fn ($app) => new Cart($app->make(Request::class)));Fixes
- Report unknown calls on stubbed facades (
App,DB,Event,Route,Schema) again; a misspelled call silently returnedmixed(#2270)
Schema::hasTabel('users');
-// no issue, returns mixed
+// UndefinedMagicMethod- Keep
Stringableon Carbon,CarbonPeriod,CollectionandLazyCollection, whose stubs had dropped it (#2268)
/** @return array<string, scalar|\Stringable|null> */
function reportRow(?Carbon $lastReferralDate): array {
return ['last_referral_date' => $lastReferralDate];
- // ImplicitToStringCast
+ // no issue
}- Resolve a closure default of
env()to the closure's return type, asvalue()does at runtime; avoidclosure now givesstring|null(#2272, #2273)
env('KEY', fn (): int => 1);
-// string|Closure(): 1
+// resolves to the closure's return type, not the closure- Keep a plain receiver's own type in
when()/unless()instead ofX&static, so returning it from a: staticmethod reportsMoreSpecificReturnType(#2271) - Print plugin warnings (plugin disabled, degraded boot, skipped checks) to STDERR under
--no-progress, and stop aborting the run when the deprecatedPSALM_LARAVEL_PLUGIN_CACHE_PATHenv var is set (#2274)
Full Changelog: v4.19.3...v4.19.4