What's Changed
Three new opt-in rules, expanded taint coverage, and fewer false positives across the board (focus on __() and trans()).
New Rules
MissingView: Detect missing Blade view files inview()andView::make()calls (#579) @alies-devModelMakeDiscouraged: Detect undefined translation keys in__()andtrans()calls (#595) @alies-devMissingTranslation: Warn againstModel::make()in favor ofnew Model()@alies-dev
Type Improvements
- Narrow
__()andtrans()return type tostring|array(wasmixed) (#592) @alies-dev - Narrow
__()return tostringwhen the translation key is known to exist @alies-dev - Suppress false-positive
MissingTemplateParamonHasFactorytrait (#517) @alies-dev - Skip method forwarding for methods defined directly on
Model(#498) @alies-dev - Add missing
implementsclauses to 15 stubs (#615) @alies-dev - Fix
morphTostub to bypass$thisissue in generics @alies-dev - Fix
morphToMany/morphedByManysignatures @alies-dev - Add
@return statictoStringablestub methods @alies-dev
Security (Taint Analysis)
- 🛡️ Add
@psalm-taint-source inputfor Route parameter methods (#608) @alies-dev - 🛡️ Add taint sinks for Redis
eval/executeRaw(Lua injection) @alies-dev - 🛡️ Add header taint sinks for
CookieJarmethods @alies-dev - 🛡️ Add
$path/$domainsinks toCookie::expire()andforget()@alies-dev - 🛡️ Add taint flow tracking through
Str::of(),str(), andStringable@alies-dev - 🛡️ Mark
Hash::make()andbcrypt()as@psalm-taint-escape system_secret@alies-dev
Benchmark
Tested against 10 real-world Laravel apps (bagisto, coolify, monica, pixelfed, solidtime, unit3d, vito, and others). Combined results vs v4.4.0:
| Metric | v4.4.0 | v4.5.0 | Delta |
|---|---|---|---|
| Total issues | 84,503 | 76,123 | -9.9% |
| Plugin-caused false positives | 5,115 | 4,155 | -18.8% |
| Security findings (taint) | 83 | 84 | +1 |
Full Changelog: v4.4.0...v4.5.0