---
name: phpstan
description: "Use when adopting PHPStan to assess this standard: Check PHP type assumptions"
---

# Apply PHPStan

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

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by PHPStan.
2. 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.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://phpstan.org/) for configuration and prerequisites.

## Tool invocation

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