Error levels

Psalm can run at error levels 1 (strictest) through 8 (most lenient). The default is level 2.

A stricter level (lower number) reports more issues as errors. A more lenient level (higher number) demotes issues to info (non-blocking).

Quick-reference summary

Level Strictness What changes compared to the level above
1 (strictest) Everything is an error Adds Mixed* issues, LessSpecificReturnType as errors
2 (default) Most issues Mixed* demoted to info
3 Moderate Deprecated*, MissingParamType, PropertyNotSetInConstructor demoted to info
4 Lenient Possibly* issues demoted to info
5 More lenient InvalidScalarArgument, RedundantCondition, TooManyArguments demoted to info
6 Very lenient FalsableReturnStatement, InvalidNullableReturnType demoted to info
7 Extremely lenient InvalidArgument, InvalidMethodCall, UndefinedMethod demoted to info
8 (most lenient) Almost nothing MethodSignatureMismatch, UninitializedProperty demoted to info

Special categories

  • Always errors: Issues with very low false-positive rates (e.g., UndefinedClass, UndefinedVariable). These cannot be suppressed by changing the error level.
  • Feature-specific errors: Issues only reported when their feature is enabled (e.g., --taint-analysis for Tainted*, --find-unused-code for Unused*). When enabled, they are always treated as errors.

Always treated as errors

These issues have very low false-positive rates and indicate definite problems. They cannot be suppressed by changing the error level.

Errors that only appear at level 1

At the default level (2), these are reported as info. Set errorLevel="1" to treat them as errors.

Errors at level 2 and below

These issues become info (non-blocking) at level 3 and higher.

Errors at level 3 and below

These issues become info (non-blocking) at level 4 and higher.

Errors at level 4 and below

These issues become info (non-blocking) at level 5 and higher.

Errors at level 5 and below

These issues become info (non-blocking) at level 6 and higher.

Errors at level 6 and below

These issues become info (non-blocking) at level 7 and higher.

Errors at level 7 and below

These issues become info (non-blocking) at level 8.

Feature-specific errors

These issues are only reported when their corresponding feature is enabled (e.g., --taint-analysis for Tainted issues, --find-unused-code for Unused issues). When enabled, they are always treated as errors.