3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00
Files
snipe-it/phpstan.neon.dist
2026-08-06 15:11:23 +01:00

54 lines
2.2 KiB
Plaintext

includes:
- ./vendor/larastan/larastan/extension.neon
- phpstan-baseline.neon
parameters:
paths:
- app
- config
- database
- routes
# Level 4 catches dead code branches, always-false instanceof,
# unreachable code after return, and most type-mismatch classes
# of bug. Anything higher (5+) starts flagging Laravel-magic paths
# that need bigger config investments to satisfy. Raise later if
# the noise budget allows. Baseline captures pre-existing findings
# so CI stays green on this PR; new findings on future PRs will
# still fail the check. Unused-parameter detection is handled by
# PHPMD (see phpmd-ruleset.xml) since PHPStan intentionally omits
# that check to avoid false positives on interface-conforming
# methods.
level: 4
# Snipe-IT supports PHP 8.2 through 8.5. Setting phpVersion to the
# MINIMUM supported version makes PHPStan flag any 8.3+ syntax
# (typed class constants, json_validate, property hooks, etc.)
# that would break on an 8.2 deployment. The analyzer itself runs
# under whatever version CI provides; only the target check moves.
phpVersion: 80200
# Larastan's facade / interface class-map resolution varies slightly
# between fresh CI installs and long-lived local vendor trees, so a
# baseline entry generated in one environment can be "unmatched" in
# the other. Tolerate unmatched entries rather than fail — the
# baseline is an allow-list, not a must-match assertion. Real
# regressions still fail because they'd be genuine NEW findings
# that aren't in the baseline.
reportUnmatchedIgnoredErrors: false
parallel:
maximumNumberOfProcesses: 4
# Larastan already understands Laravel Eloquent shapes at level 4.
# Ignore common false positives so signal stays useful.
ignoreErrors:
# $model->save() returns bool but analyzers sometimes flag it as
# unused when the caller doesn't branch on it; Snipe-IT has
# deliberate fire-and-forget saves in observers where the
# return value adds no information.
-
message: '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder#'
paths:
- app/Models/*.php