--dev scope).psalm.xml) setup.vimeo/psalm or laravel/psalm-plugin). The package abstracts dependency management, simplifying setup.@mixin, @property annotations).__get(), __call()) may trigger noise.phpstan/extension-installer), which may increase composer.json complexity.Illuminate\Support\Facades)?@mixin?errorLevel) are acceptable?--dev scope ensures no runtime impact.phpunit.xml configuration).composer require --dev innmind/static-analysis).psalm.xml with lenient settings (errorLevel="3" → start)../vendor/bin/psalm --init to generate a baseline.src/ directory; ignore vendor/ and tests/ initially.@mixin for Facades).errorLevel="1").composer.json scripts:
"scripts": {
"psalm": "vendor/bin/psalm --no-cache",
"psalm-fix": "vendor/bin/psalm --fix"
}
vimeo/psalm or laravel/psalm-plugin). For older versions, manual configuration may be needed.phpstan/extension-installer or roave/security-advisories. Resolve via composer.json overrides.__get() in models). Mitigate with:
<mixins>
<mixin from="Illuminate\Database\Eloquent\Model" />
</mixins>
| Step | Priority | Dependencies | Output |
|---|---|---|---|
| Install package | High | Composer access | innmind/static-analysis |
Configure psalm.xml |
High | Project structure (src/) |
Baseline Psalm config |
| Run initial scan | Medium | psalm.xml |
Baseline file (psalm-baseline.xml) |
| CI/CD integration | Low | CI pipeline access | Failing builds on errors |
| Refine configurations | Ongoing | Developer feedback | Tuned psalm.xml |
psalm.xml and @mixin annotations are recommended.composer.json if stability is critical:
"require-dev": {
"innmind/static-analysis": "^1.0",
"vimeo/psalm": "^5.0"
}
psalm-baseline.xml) and document suppressed errors.MixedReturnType, UndefinedClass).@mixin, @property).--no-cache flag to bypass stale analysis.src/ files by default. For large codebases, use:
<projectFiles>
<directory name="src" excludeFiles="\\.blade\\.php$" />
</projectFiles>
--cache-globals for faster subsequent runs.--parallel) in CI.psalm.xml in a monorepo or shared config repo.| Failure Mode | Impact | Mitigation |
|---|---|---|
| Psalm blocks merges | Slows down development | Start with errorLevel="3" → tighten later. |
| False positives in CI | Noisy builds | Maintain psalm-baseline.xml. |
| Laravel-specific errors | Misleading type hints | Use @mixin for Facades/Models. |
| Dependency conflicts | Broken builds | Pin versions in composer.json. |
| Outdated Psalm rules | Missed bugs | Subscribe to Psalm changelog. |
How can I help you explore Laravel packages today?