# PHPStan

Check PHP type assumptions

Analyze project code at an explicit rule level. Capture existing errors in a reviewed baseline and require new code to satisfy the chosen level.

Category: Type safety
Languages: PHP

## Standard evidence

Rubric v1 · 3/8 verified · 5 unknown · 0 contrary · reviewed 2026-11-28

- **Definition** (verified) — PHPStan publishes cumulative analysis levels with different type requirements. The adopted level determines which type assumptions fail. Reviewed 2026-11-28. [Source](https://phpstan.org/user-guide/rule-levels)
- **Measurement** (verified) — The analyse command reports type errors for selected paths; a successful error-free analysis exits 0. Reviewed 2026-11-28. [Source](https://phpstan.org/user-guide/command-line-usage)
- **Conformance** (unknown) — No reviewed evidence is recorded for this dimension.
- **CI enforcement** (unknown) — No reviewed evidence is recorded for this dimension.
- **Getting started** (unknown) — No reviewed evidence is recorded for this dimension.
- **Real-world adoption** (verified) — CodeRabbit applies PHPStan to configured PHP paths, preferring the repository Composer binary and choosing its analysis level by review policy. Reviewed 2026-11-28. [Source](https://docs.coderabbit.ai/tools/phpstan)
- **Agent guidance** (unknown) — No reviewed evidence is recorded for this dimension.
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.

## Adoption

Use PHPStan in this repository to meet this standard: Check PHP type assumptions. Analyze project code at an explicit rule level. Capture existing errors in a reviewed baseline and require new code to satisfy the chosen level. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.

### Tool command

```
vendor/bin/phpstan analyse
```

Seikika package: no verified installation is listed.

## References

- [Tool documentation](https://phpstan.org/)
- [Agent skill](/skills/phpstan/SKILL.md)
