fleetlint Policy for a fleet of repositories
v0.5
Getting started

types/strict/php

The type checker runs in strict mode

Implements types/strict for php.

Severitywarning
Tiers1, 2
Stacksphp
Scopeeach
Kindoutcome
Sourcelibrary v0.2.0
Selected byfleetlint-recommended@v0.2.0

Requirement

PHPStan runs at level: max (or 9 or 10) or Psalm at errorLevel="1", configured in the project or a parent directory; a generated baseline is the ratchet for existing code. Another analyzer is added with accept:.

Why

PHPStan’s lower levels skip mixed types and missing type information, which is exactly what the analyzer is there to refuse.

Fix

Set level: max in phpstan.neon.dist and ratchet existing errors with vendor/bin/phpstan analyse --generate-baseline.

Agent instruction: Set level: max in phpstan.neon.dist, generate a baseline for existing errors, and fix new code to pass without it.

See: https://fleetlint.org/baseline/#static-analysis, https://fleetlint.org/stacks/#php


Generated by fleetlint docs from catalog v0.2.0.