Skip to content

Error codes

Every issue mir emits carries a stable identifier of the form MIR####. The code appears in CLI output and JSON/SARIF output:

src/x.php:12:4 error[MIR0005] UndefinedClass: Class Foo not found

Codes are organized into bands by category. Bands have headroom for growth; once a code ships, it is never reused for a different issue. Renamed issues keep their code.

RangeCategory
MIR0001–0099Undefined symbols
MIR0100–0199Nullability
MIR0200–0299Type mismatches
MIR0300–0399Array / offset
MIR0400–0499Redundancy
MIR0500–0599Dead code
MIR0600–0699Readonly
MIR0700–0799Inheritance
MIR0800–0899Security (taint)
MIR0900–0999Generics
MIR1000–1099Deprecation / internal
MIR1100–1199Missing types / docblocks
MIR1200–1299Mixed
MIR1300–1399Trait
MIR1400–1499Parse
MIR1500–1599Other
MIR1600–1699Attributes
CodeNamePage
MIR0001InvalidScopeundefined/invalid-scope
MIR0002UndefinedVariableundefined/undefined-variable
MIR0003UndefinedFunctionundefined/undefined-function
MIR0004UndefinedMethodundefined/undefined-method
MIR0005UndefinedClassundefined/undefined-class
MIR0006UndefinedPropertyundefined/undefined-property
MIR0007UndefinedConstantundefined/undefined-constant
MIR0008PossiblyUndefinedVariableundefined/possibly-undefined-variable
MIR0009UndefinedTraitundefined/undefined-trait
MIR0010ParentNotFoundundefined/parent-not-found
MIR0011InaccessibleClassConstantundefined/inaccessible-class-constant
MIR0100NullArgumentnullability/null-argument
MIR0101NullPropertyFetchnullability/null-property-fetch
MIR0102NullMethodCallnullability/null-method-call
MIR0103NullArrayAccessnullability/null-array-access
MIR0104PossiblyNullArgumentnullability/possibly-null-argument
MIR0105PossiblyInvalidArgumentnullability/possibly-invalid-argument
MIR0106PossiblyNullPropertyFetchnullability/possibly-null-property-fetch
MIR0107PossiblyNullMethodCallnullability/possibly-null-method-call
MIR0108PossiblyNullArrayAccessnullability/possibly-null-array-access
MIR0109NullableReturnStatementnullability/nullable-return-statement
MIR0200InvalidReturnTypetype-mismatches/invalid-return-type
MIR0201InvalidArgumenttype-mismatches/invalid-argument
MIR0202TooFewArgumentstype-mismatches/too-few-arguments
MIR0203TooManyArgumentstype-mismatches/too-many-arguments
MIR0204InvalidNamedArgumenttype-mismatches/invalid-named-argument
MIR0205InvalidPassByReferencetype-mismatches/invalid-pass-by-reference
MIR0206InvalidPropertyAssignmenttype-mismatches/invalid-property-assignment
MIR0207InvalidCasttype-mismatches/invalid-cast
MIR0208InvalidOperandtype-mismatches/invalid-operand
MIR0209MismatchingDocblockReturnTypetype-mismatches/mismatching-docblock-return-type
MIR0210MismatchingDocblockParamTypetype-mismatches/mismatching-docblock-param-type
MIR0211InvalidStringClasstype-mismatches/invalid-string-class
MIR0212TypeCheckMismatchtype-mismatches/type-check-mismatch
MIR0213PossiblyInvalidOperandtype-mismatches/possibly-invalid-operand
MIR0214PossiblyNullOperandtype-mismatches/possibly-null-operand
MIR0215InvalidStaticInvocationtype-mismatches/invalid-static-invocation
MIR0216NonStaticSelfCalltype-mismatches/non-static-self-call
MIR0217DirectConstructorCalltype-mismatches/direct-constructor-call
MIR0218InvalidPropertyFetchtype-mismatches/invalid-property-fetch
MIR0219InvalidArrayAccesstype-mismatches/invalid-array-access
MIR0220InvalidArrayAssignmenttype-mismatches/invalid-array-assignment
MIR0221Tracetype-mismatches/trace
MIR0222RawObjectIterationtype-mismatches/raw-object-iteration
MIR0223PossiblyRawObjectIterationtype-mismatches/possibly-raw-object-iteration
MIR0224InvalidNamedArgumentstype-mismatches/invalid-named-arguments
MIR0225ArgumentTypeCoerciontype-mismatches/argument-type-coercion
MIR0226PropertyTypeCoerciontype-mismatches/property-type-coercion
MIR0227PossiblyInvalidArrayAccesstype-mismatches/possibly-invalid-array-access
MIR0300InvalidArrayOffsetarray/invalid-array-offset
MIR0301NonExistentArrayOffsetarray/non-existent-array-offset
MIR0302PossiblyInvalidArrayOffsetarray/possibly-invalid-array-offset
MIR0400RedundantConditionredundancy/redundant-condition
MIR0401RedundantCastredundancy/redundant-cast
MIR0402UnnecessaryVarAnnotationredundancy/unnecessary-var-annotation
MIR0403TypeDoesNotContainTyperedundancy/type-does-not-contain-type
MIR0404ParadoxicalConditionredundancy/paradoxical-condition
MIR0405UnhandledMatchConditionredundancy/unhandled-match-condition
MIR0406DocblockTypeContradictionredundancy/docblock-type-contradiction
MIR0407UnevaluatedCoderedundancy/unevaluated-code
MIR0500UnusedVariabledead-code/unused-variable
MIR0501UnusedParamdead-code/unused-param
MIR0502UnreachableCodedead-code/unreachable-code
MIR0503UnusedMethoddead-code/unused-method
MIR0504UnusedPropertydead-code/unused-property
MIR0505UnusedFunctiondead-code/unused-function
MIR0506UnusedForeachValuedead-code/unused-foreach-value
MIR0507UnusedClassdead-code/unused-class
MIR0508UnusedSuppressdead-code/unused-suppress
MIR0600ReadonlyPropertyAssignmentother/readonly-property-assignment
MIR0700UnimplementedAbstractMethodinheritance/unimplemented-abstract-method
MIR0701UnimplementedInterfaceMethodinheritance/unimplemented-interface-method
MIR0702MethodSignatureMismatchinheritance/method-signature-mismatch
MIR0703OverriddenMethodAccessinheritance/overridden-method-access
MIR0704InvalidExtendClassinheritance/invalid-extend-class
MIR0705FinalMethodOverriddeninheritance/final-method-overridden
MIR0706AbstractInstantiationinheritance/abstract-instantiation
MIR0707CircularInheritanceinheritance/circular-inheritance
MIR0708InvalidOverrideinheritance/invalid-override
MIR0709InterfaceInstantiationinheritance/interface-instantiation
MIR0710OverriddenPropertyAccessinheritance/overridden-property-access
MIR0711AbstractMethodCallinheritance/abstract-method-call
MIR0800TaintedInputsecurity/tainted-input
MIR0801TaintedHtmlsecurity/tainted-html
MIR0802TaintedSqlsecurity/tainted-sql
MIR0803TaintedShellsecurity/tainted-shell
MIR0804TaintedLlmPromptsecurity/tainted-llm-prompt
MIR0900InvalidTemplateParamgenerics/invalid-template-param
MIR0901ShadowedTemplateParamgenerics/shadowed-template-param
MIR0902IfThisIsMismatchgenerics/if-this-is-mismatch
MIR1000DeprecatedCallother/deprecated-call
MIR1001DeprecatedMethodCallother/deprecated-method-call
MIR1002DeprecatedMethodother/deprecated-method
MIR1003DeprecatedClassother/deprecated-class
MIR1004InternalMethodother/internal-method
MIR1005DeprecatedPropertyother/deprecated-property
MIR1006DeprecatedInterfaceother/deprecated-interface
MIR1007DeprecatedTraitother/deprecated-trait
MIR1008DeprecatedConstantother/deprecated-constant
MIR1009WrongCaseFunctionother/wrong-case-function
MIR1010WrongCaseMethodother/wrong-case-method
MIR1011WrongCaseClassother/wrong-case-class
MIR1100MissingReturnTypeother/missing-return-type
MIR1101MissingParamTypeother/missing-param-type
MIR1102MissingThrowsDocblockother/missing-throws-docblock
MIR1103InvalidDocblockother/invalid-docblock
MIR1104MissingPropertyTypeother/missing-property-type
MIR1105MissingClosureReturnTypeother/missing-closure-return-type
MIR1200MixedArgumentother/mixed-argument
MIR1201MixedAssignmentother/mixed-assignment
MIR1202MixedMethodCallother/mixed-method-call
MIR1203MixedPropertyFetchother/mixed-property-fetch
MIR1204MixedCloneother/mixed-clone
MIR1205InvalidCloneother/invalid-clone
MIR1206PossiblyInvalidCloneother/possibly-invalid-clone
MIR1207InvalidToStringother/invalid-to-string
MIR1208MixedPropertyAssignmentother/mixed-property-assignment
MIR1209MixedArrayAccessother/mixed-array-access
MIR1210MixedArrayOffsetother/mixed-array-offset
MIR1211MixedFunctionCallother/mixed-function-call
MIR1212MixedReturnStatementother/mixed-return-statement
MIR1300InvalidTraitUseother/invalid-trait-use
MIR1301ForbiddenCodeother/forbidden-code
MIR1400ParseErrorother/parse-error
MIR1500InvalidThrowother/invalid-throw
MIR1501ImplicitToStringCastother/implicit-to-string-cast
MIR1502ImplicitFloatToIntCastother/implicit-float-to-int-cast
MIR1503InvalidCatchother/invalid-catch
MIR1504NoInterfacePropertiesother/no-interface-properties
MIR1505UndefinedDocblockClassother/undefined-docblock-class
MIR1506UnsupportedReferenceUsageother/unsupported-reference-usage
MIR1507MissingConstructorother/missing-constructor
MIR1600InvalidAttributeattributes/invalid-attribute
MIR1601UndefinedAttributeClassattributes/undefined-attribute-class
MIR1602DuplicateClassattributes/duplicate-class
MIR1603DuplicateInterfaceattributes/duplicate-interface
MIR1604DuplicateTraitattributes/duplicate-trait
MIR1605DuplicateEnumattributes/duplicate-enum
MIR1606DuplicateFunctionattributes/duplicate-function
MIR1700ImpurePropertyAssignmentother/impure-property-assignment
MIR1701ImpureMethodCallother/impure-method-call
MIR1702ImpureGlobalVariableother/impure-global-variable
MIR1703ImpureStaticVariableother/impure-static-variable
MIR1704ImpureFunctionCallother/impure-function-call