PHP lints, page 2 of 2
The lint rules of PHP, with what each one finds. This page has 315 cards.
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullArrayAccess
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullArrayAssignment
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullArrayOffset
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullFunctionCall
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullIterator
Psalm reports it only at error level 1, the strictest level.
- Code
PossiblyNullOperand
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullPropertyAssignment
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullPropertyAssignmentValue
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullPropertyFetch
Psalm ignores it at error level 4 and higher.
- Code
PossiblyNullReference
Psalm ignores it at error level 4 and higher.
- Code
PossiblyUndefinedArrayOffset
Psalm ignores it at error level 4 and higher.
- Code
PossiblyUndefinedGlobalVariable
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUndefinedIntArrayOffset
Psalm ignores it at error level 4 and higher.
- Code
PossiblyUndefinedMethod
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUndefinedStringArrayOffset
Psalm ignores it at error level 4 and higher.
- Code
PossiblyUndefinedVariable
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUnusedMethod
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUnusedParam
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUnusedProperty
Psalm reports it only when a feature of the configuration enables it.
- Code
PossiblyUnusedReturnValue
PHP 8.0+ emits a warning when it sees private final method (except __construct where it's allowed), and allows redefinition in child classes (effectively ignoring final modifier). Before PHP 8.0, final was respected in this case. Psalm ignores it at error level 3 and higher.
- Code
PrivateFinalMethod
To prevent mistakes, Psalm will enforce that all properties should be initialized. Psalm ignores it at error level 3 and higher.
- Code
PropertyNotSetInConstructor
Psalm ignores it at error level 4 and higher.
- Code
PropertyTypeCoercion
This issue exists because it may be undesired behaviour (e.g. you may have meant to iterate over an array). Psalm ignores it at error level 3 and higher.
- Code
RawObjectIteration
Psalm ignores it at error level 5 and higher.
- Code
RedundantCast
Psalm ignores it at error level 3 and higher.
- Code
RedundantCastGivenDocblockType
Psalm ignores it at error level 5 and higher.
- Code
RedundantCondition
Psalm ignores it at error level 3 and higher.
- Code
RedundantConditionGivenDocblockType
FILTER_NULL_ON_FAILURE won't do anything when the default option is specified. Psalm reports it only at error level 1, the strictest level.
- Code
RedundantFlag
Psalm ignores it at error level 5 and higher.
- Code
RedundantFunctionCall
Psalm ignores it at error level 3 and higher.
- Code
RedundantFunctionCallGivenDocblockType
Psalm reports it only at error level 1, the strictest level.
- Code
RedundantIdentityWithTrue
To prevent mistakes, Psalm will enforce that all properties should be initialized. Psalm ignores it at error level 5 and higher.
- Code
RedundantPropertyInitializationCheck
Psalm ignores it at error level 3 and higher.
- Code
ReferenceConstraintViolation
Since PHP doesn't scope loops and ifs the same way most other languages do, a common issue is the reuse of a variable declared in such a scope. Usually it doesn't matter, because a reassignment to an already-defined variable will just reassign it, but if the already-defined variable is a reference it will change the value of the referred to variable. Psalm ignores it at error level 5 and higher.
- Code
ReferenceReusedFromConfusingScope
Psalm ignores it at error level 8.
- Code
ReservedWord
Psalm ignores it at error level 4 and higher.
- Code
RiskyCast
Psalm ignores it at error level 3 and higher.
- Code
RiskyTruthyFalsyComparison
This works in PHP, but is unexpected behaviour for most people, and it is deprecated as of PHP 8.5: use str_increment() (available since PHP 8.3) instead. The issue is emitted whatever the PHP version the code is analysed for. Psalm ignores it at error level 5 and higher.
- Code
StringIncrement
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedCallable
This rule is emitted when user-controlled input can be passed into a cookie. Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedCookie
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedCustom
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedEval
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedFile
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedHtml
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedInclude
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedInput
This rule is emitted when user-controlled input can be passed into an LDAP request. Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedLdap
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedShell
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedSleep
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedSql
This rule is emitted when user-controlled input can be passed into a network request. Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedSSRF
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedSystemSecret
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedTextWithQuotes
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedUnserialize
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedUserSecret
Psalm reports it only when a feature of the configuration enables it.
- Code
TaintedXpath
Psalm reports it at each error level.
- Code
TooFewArguments
Psalm ignores it at error level 5 and higher.
- Code
TooManyArguments
Psalm ignores it at error level 7 and higher.
- Code
TooManyTemplateParams
Just reports the type of a variable when using @psalm-trace. Psalm reports it only at error level 1, the strictest level.
- Code
Trace
Psalm ignores it at error level 7 and higher.
- Code
TraitMethodSignatureMismatch
Psalm ignores it at error level 5 and higher.
- Code
TypeDoesNotContainNull
Psalm ignores it at error level 5 and higher.
- Code
TypeDoesNotContainType
Psalm reports it only when a feature of the configuration enables it.
- Code
UncaughtThrowInGlobalScope
Psalm reports it at each error level.
- Code
UndefinedAttributeClass
Psalm reports it at each error level.
- Code
UndefinedClass
Psalm reports it at each error level.
- Code
UndefinedConstant
Psalm reports it at each error level.
- Code
UndefinedDocblockClass
Psalm reports it at each error level.
- Code
UndefinedFunction
Psalm reports it at each error level.
- Code
UndefinedGlobalVariable
Psalm reports it at each error level.
- Code
UndefinedInterface
Psalm ignores it at error level 6 and higher.
- Code
UndefinedInterfaceMethod
Psalm ignores it at error level 5 and higher.
- Code
UndefinedMagicMethod
Psalm ignores it at error level 5 and higher.
- Code
UndefinedMagicPropertyAssignment
Psalm ignores it at error level 5 and higher.
- Code
UndefinedMagicPropertyFetch
Psalm ignores it at error level 7 and higher.
- Code
UndefinedMethod
Psalm ignores it at error level 7 and higher.
- Code
UndefinedPropertyAssignment
Psalm ignores it at error level 7 and higher.
- Code
UndefinedPropertyFetch
Psalm ignores it at error level 6 and higher.
- Code
UndefinedThisPropertyAssignment
Psalm ignores it at error level 7 and higher.
- Code
UndefinedThisPropertyFetch
Psalm ignores it at error level 3 and higher.
- Code
UndefinedTrace
Psalm reports it at each error level.
- Code
UndefinedTrait
Psalm reports it at each error level.
- Code
UndefinedVariable
Psalm reports it only when a feature of the configuration enables it.
- Code
UnevaluatedCode
Psalm ignores it at error level 8.
- Code
UnhandledMatchCondition
Psalm reports it at each error level.
- Code
UnimplementedAbstractMethod
Psalm reports it at each error level.
- Code
UnimplementedInterfaceMethod
Psalm ignores it at error level 8.
- Code
UninitializedProperty
Psalm reports it only when a feature of the configuration enables it.
- Code
UnnecessaryVarAnnotation
This should never happen. Psalm reports it at each error level.
- Code
UnrecognizedExpression
This should never happen. Psalm reports it at each error level.
- Code
UnrecognizedStatement
Note that static::CONST is considered unresolvable for key-of and value-of, since the literal keys and values can't be resolved due to the possibility of being overridden by child classes. Psalm reports it at each error level.
- Code
UnresolvableConstant
Psalm ignores it at error level 3 and higher.
- Code
UnresolvableInclude
Psalm ignores it at error level 3 and higher.
- Code
UnsafeGenericInstantiation
Psalm ignores it at error level 3 and higher.
- Code
UnsafeInstantiation
Psalm reports it at each error level.
- Code
UnsupportedPropertyReferenceUsage
When an unsupported reference is encountered, Psalm will issue this warning and treat the variable as though it wasn't actually a reference. Psalm ignores it at error level 3 and higher.
- Code
UnsupportedReferenceUsage
Psalm reports it at each error level.
- Code
UnusedBaselineEntry
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedClass
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedClosureParam
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedConstructor
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedDocblockParam
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedForeachValue
Psalm reports it at each error level.
- Code
UnusedFunctionCall
Psalm reports it at each error level.
- Code
UnusedIssueHandlerSuppression
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedMethod
Psalm reports it at each error level.
- Code
UnusedMethodCall
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedParam
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedProperty
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedPsalmSuppress
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedReturnValue
Psalm reports it only when a feature of the configuration enables it.
- Code
UnusedVariable