psalm/plugin-laravel
Laravel Psalm plugin for deep static analysis plus taint-based security scanning. Detects SQL injection, XSS, SSRF, shell injection, path traversal, and open redirects by tracking user input through Laravel code without running it.
whereDate() with DateTimeInterface values (e.g., Carbon) demonstrates continued alignment with Laravel’s evolving API.composer require and psalm-laravel init. The fix for whereDate() reduces manual stubbing for common Carbon/Laravel patterns.whereDate() fix reduces false positives for Carbon-based queries.whereDate() fix mitigates a specific false positive for DateTimeInterface in Eloquent queries, improving accuracy for Carbon/Laravel users.psalm.xml.whereDate() fix lowers the barrier for Carbon-heavy projects.whereDate() with DateTimeInterface values? If so, this fix resolves a prior false positive.whereTime, whereMonth) that may still trigger false positives?whereDate() fix reduce CI runtime by eliminating suppressed errors?--level 3) without overwhelming developers?whereDate() fix specifically benefits:
composer require psalm/plugin-laravel:^4.8../vendor/bin/psalm --set-baseline=psalm-baseline.xml --ignore-baseline
Critical: Re-generate the baseline to incorporate the whereDate() fix and avoid suppressing resolved issues.psalm-laravel add github or manual workflows.psalm.xml to include the fix’s scope:
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin" />
</plugins>
<taintAnalysis>
<source>Psalm\LaravelPlugin\TaintSources\RequestInput</source>
<sink>Psalm\LaravelPlugin\TaintSinks\SqlQueryBuilder</sink>
</taintAnalysis>
Note: The whereDate() fix reduces the need for @psalm-suppress annotations for Carbon-based queries.AliasLoader.--level 4 to balance strictness and noise.TaintedSql errors (security-critical) over type issues.whereDate() resolution may reduce false positives in date-related queries.--output-format=github), then enable failure gates for critical paths.whereDate() fix suggests improved Eloquent support but may introduce new risks.psalm.xml if new Laravel features (e.g., Eloquent 10+) require taint analysis adjustments.whereDate() errors.--no-cache for troubleshooting.psalm.log for traces; refer to the issue catalog.whereDate()-related errors, verify Carbon/Laravel versions are compatible.psalm.xml (exclude tests/).--threads=4).rm -rf ~/.cache/psalm).igbinary for speed.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Psalm 7 beta instability | CI failures | Pin to a stable Psalm 7.x release. |
False positives (e.g., whereDate) |
Low adoption | Re-generate baseline; suppress selectively. |
| Taint analysis misses edge cases | Security gaps | Combine with runtime scanning (e.g., Snyk). |
| Baseline bloat | Hard to maintain | Regenerate baseline annually. |
| New Risk: Eloquent API changes | Plugin breaks | Downgrade to last stable version if needed. |
whereDate() fix as a resolved false positive for Carbon queries.Post::query()->whereDate('created_at', Carbon::now()) no longer triggers ImplicitToStringCast.How can I help you explore Laravel packages today?