1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[repr(u16)]
11#[non_exhaustive]
12pub enum IssueCode {
13 AbstractClassUsedAsAttribute,
14 AbstractInstantiation,
15 AlwaysMatchingSwitchCase,
16 AmbiguousClassLikeConstantAccess,
17 AmbiguousInstantiationTarget,
18 AmbiguousObjectMethodAccess,
19 AmbiguousObjectPropertyAccess,
20 ArrayAppendInReadContext,
21 ArrayAppendOverflow,
22 ArrayToStringConversion,
23 AssignmentToConstant,
24 AssignmentToThis,
25 AttributeNotRepeatable,
26 AvoidCatchingError,
27 BackedPropertyReferenceHook,
28 CatchTypeNotThrowable,
29 ClassMustBeFinal,
30 ClassNotMarkedAsAttribute,
31 CloneInsideLoop,
32 ConditionIsTooComplex,
33 ConflictingReferenceConstraint,
34 ConflictingTemplateEqualityBounds,
35 DeprecatedClass,
36 DeprecatedClosure,
37 DeprecatedConstant,
38 DeprecatedFeature,
39 DeprecatedFunction,
40 DeprecatedMethod,
41 DeprecatedTrait,
42 DirectTraitConstantAccess,
43 DocblockParameterNarrowing,
44 DocblockTypeMismatch,
45 DuplicateArrayKey,
46 DuplicateCaughtType,
47 DuplicateClosureUseVariable,
48 DuplicateDefinition,
49 DuplicateEnumCaseValue,
50 DuplicateNamedArgument,
51 DuplicateSwitchCase,
52 DynamicStaticMethodCall,
53 EmptyMatchExpression,
54 EnumInstantiation,
55 EnumIteration,
56 ExcessTemplateParameter,
57 ExperimentalUsage,
58 ExpressionIsTooComplex,
59 ExtendFinalClass,
60 FalsableReturnStatement,
61 FalseArgument,
62 FalseArrayAccess,
63 FalseIterator,
64 FalseOperand,
65 GenericObjectIteration,
66 HiddenGeneratorReturn,
67 ImplicitResourceToStringCast,
68 ImplicitToStringCast,
69 ImpossibleArrayAccess,
70 ImpossibleArrayAssignment,
71 ImpossibleAssignment,
72 ImpossibleCondition,
73 ImpossibleKeyCheck,
74 ImpossibleNonnullEntryCheck,
75 ImpossibleNullTypeComparison,
76 ImpossibleTypeComparison,
77 ImpreciseType,
78 ImpureConstruct,
79 ImpureStaticVariable,
80 IncompatibleConstantAccess,
81 IncompatibleConstantOverride,
82 IncompatibleConstantType,
83 IncompatibleConstantVisibility,
84 IncompatibleParameterCount,
85 IncompatibleParameterName,
86 IncompatibleParameterType,
87 IncompatiblePropertyAccess,
88 IncompatiblePropertyDefault,
89 IncompatiblePropertyHookParameterType,
90 IncompatiblePropertyHookSignature,
91 IncompatiblePropertyOverride,
92 IncompatiblePropertyReadonly,
93 IncompatiblePropertyStatic,
94 IncompatiblePropertyType,
95 IncompatiblePropertyVisibility,
96 IncompatibleReadonlyModifier,
97 IncompatibleReturnType,
98 IncompatibleStaticModifier,
99 IncompatibleTemplateLowerBound,
100 IncompatibleVisibility,
101 InconsistentTemplate,
102 IncorrectClassLikeCasing,
103 IncorrectFunctionCasing,
104 InterfaceInstantiation,
105 InvalidArgument,
106 InvalidArrayAccess,
107 InvalidArrayAccessAssignmentValue,
108 InvalidArrayElement,
109 InvalidArrayElementKey,
110 InvalidArrayIndex,
111 InvalidAssignment,
112 InvalidAttributeTarget,
113 InvalidBreak,
114 InvalidCallable,
115 InvalidCatchType,
116 InvalidCatchTypeNotClassOrInterface,
117 InvalidClassConstantOnString,
118 InvalidClassStringExpression,
119 InvalidClone,
120 InvalidConstantSelector,
121 InvalidConstantValue,
122 InvalidContinue,
123 InvalidDestructuringSource,
124 InvalidDocblock,
125 InvalidEnumCaseValue,
126 InvalidExtend,
127 InvalidForeachKey,
128 InvalidForeachValue,
129 InvalidGeneratorReturnType,
130 InvalidGlobal,
131 InvalidImplement,
132 InvalidIssetExpression,
133 InvalidIterator,
134 InvalidMemberSelector,
135 InvalidMethodAccess,
136 InvalidNamedArgument,
137 InvalidOperand,
138 InvalidOverrideAttribute,
139 InvalidParameterDefaultValue,
140 InvalidParentType,
141 InvalidPassByReference,
142 InvalidPropertyAccess,
143 InvalidPropertyAssignmentValue,
144 InvalidPropertyDefaultValue,
145 InvalidPropertyRead,
146 InvalidPropertyWrite,
147 InvalidReturnStatement,
148 InvalidScopeKeywordContext,
149 InvalidStaticMethodAccess,
150 InvalidStaticMethodCall,
151 InvalidStaticPropertyAccess,
152 InvalidTemplateParameter,
153 InvalidThrow,
154 InvalidTraitAliasModifier,
155 InvalidTraitUse,
156 InvalidTypeCast,
157 InvalidUnset,
158 InvalidYieldKeyType,
159 InvalidYieldValueType,
160 LessSpecificArgument,
161 LessSpecificNestedArgumentType,
162 LessSpecificNestedReturnStatement,
163 LessSpecificReturnStatement,
164 ListDestructureNegativeKey,
165 ListDestructureStringKey,
166 ListUsedInReadContext,
167 MatchArmAlwaysTrue,
168 MatchDefaultArmAlwaysExecuted,
169 MatchExpressionOnlyDefaultArm,
170 MatchNotExhaustive,
171 MatchSubjectTypeIsNever,
172 MethodAccessOnNull,
173 MismatchedArrayIndex,
174 MissingApiOrInternal,
175 MissingConstantType,
176 MissingConstructor,
177 MissingMagicMethod,
178 MissingOverrideAttribute,
179 MissingParameterType,
180 MissingPropertyType,
181 MissingRequiredInterface,
182 MissingRequiredParent,
183 MissingReturnStatement,
184 MissingReturnType,
185 MissingTemplateParameter,
186 MixedArgument,
187 MixedArrayAccess,
188 MixedArrayAssignment,
189 MixedArrayIndex,
190 MixedAssignment,
191 MixedClone,
192 MixedDestructuringShape,
193 MixedMethodAccess,
194 MixedOperand,
195 MixedPropertyAccess,
196 MixedPropertyTypeCoercion,
197 MixedReturnStatement,
198 NameAlreadyInUse,
199 NamedArgumentAfterPositional,
200 NamedArgumentNotAllowed,
201 NamedArgumentOverridesPositional,
202 NeverMatchingSwitchCase,
203 NeverReturn,
204 NoValidCatchTypeFound,
205 NoValue,
206 NonClassUsedAsAttribute,
207 NonDocumentedConstant,
208 NonDocumentedMethod,
209 NonDocumentedProperty,
210 NonExistentAttributeClass,
211 NonExistentCatchType,
212 NonExistentClass,
213 NonExistentClassConstant,
214 NonExistentClassLike,
215 NonExistentConstant,
216 NonExistentFunction,
217 NonExistentMethod,
218 NonExistentProperty,
219 NonExistentUseImport,
220 NonIterableObjectIteration,
221 NonStaticAbstractImplementation,
222 NullArgument,
223 NullArrayAccess,
224 NullArrayIndex,
225 NullDestructuringSource,
226 NullIterator,
227 NullOperand,
228 NullPropertyAccess,
229 NullableReturnStatement,
230 OverlyWideReturnType,
231 OverrideFinalConstant,
232 OverrideFinalMethod,
233 OverrideFinalProperty,
234 OverrideFinalPropertyHook,
235 ParadoxicalCondition,
236 ParentOutsideClassScope,
237 PossibleMethodAccessOnNull,
238 PossiblyArrayAppendOverflow,
239 PossiblyFalseArgument,
240 PossiblyFalseArrayAccess,
241 PossiblyFalseIterator,
242 PossiblyFalseOperand,
243 PossiblyInvalidArgument,
244 PossiblyInvalidArrayAccess,
245 PossiblyInvalidClone,
246 PossiblyInvalidIterator,
247 PossiblyInvalidOperand,
248 PossiblyInvalidPropertyWrite,
249 PossiblyNonExistentMethod,
250 PossiblyNonExistentProperty,
251 PossiblyNullArgument,
252 PossiblyNullArrayAccess,
253 PossiblyNullArrayIndex,
254 PossiblyNullDestructuringSource,
255 PossiblyNullIterator,
256 PossiblyNullOperand,
257 PossiblyNullPropertyAccess,
258 PossiblyStaticAccessOnInterface,
259 PossiblyUndefinedArrayIndex,
260 PossiblyUndefinedIntArrayIndex,
261 PossiblyUndefinedStringArrayIndex,
262 PossiblyUndefinedVariable,
263 PropertyTypeCoercion,
264 PsalmTrace,
265 RedundantCast,
266 RedundantComparison,
267 RedundantCondition,
268 RedundantDocblockType,
269 RedundantIssetCheck,
270 RedundantKeyCheck,
271 RedundantLogicalOperation,
272 RedundantNonnullEntryCheck,
273 RedundantNonnullTypeComparison,
274 RedundantNullCoalesce,
275 RedundantNullsafeOperator,
276 RedundantTypeComparison,
277 ReferenceConstraintViolation,
278 ReferenceReusedFromConfusingScope,
279 ReferenceToUndefinedVariable,
280 SelfOutsideClassScope,
281 SideEffectsInCondition,
282 SkipInKeyedDestructuring,
283 SpreadInDestructuring,
284 StaticAccessOnInterface,
285 StaticOutsideClassScope,
286 StringConstantSelector,
287 StringMemberSelector,
288 TemplateConstraintViolation,
289 TooFewArguments,
290 TooManyArguments,
291 TraitConstantOverride,
292 TraitInstantiation,
293 TypeConfirmation,
294 TypeInspection,
295 UnavailableClassConstant,
296 UnavailableClassLike,
297 UnavailableConstant,
298 UnavailableEnumCase,
299 UnavailableFunction,
300 UnavailableMethod,
301 UnavailableProperty,
302 UndefinedIntArrayIndex,
303 UndefinedStringArrayIndex,
304 UndefinedVariable,
305 UndefinedVariableInClosureUse,
306 UnevaluatedCode,
307 UnhandledThrownType,
308 UnimplementedAbstractMethod,
309 UnimplementedAbstractPropertyHook,
310 UninitializedProperty,
311 UnknownClassInstantiation,
312 UnknownConstantSelectorType,
313 UnknownIteratorType,
314 UnknownMatchSubjectType,
315 UnknownMemberSelectorType,
316 UnknownYieldFromIteratorType,
317 UnreachableElseClause,
318 UnreachableMatchArm,
319 UnreachableMatchDefaultArm,
320 UnreachableSwitchCase,
321 UnreachableSwitchDefault,
322 UnresolvableClassConstant,
323 UnsafeInstantiation,
324 UnusedFunctionCall,
325 UnusedMethod,
326 UnusedMethodCall,
327 UnusedParameter,
328 UnusedProperty,
329 UnusedStatement,
330 UnusedTemplateParameter,
331 UselessControlFlow,
332 WhereConstraintViolation,
333 WriteOnlyProperty,
334 YieldFromInvalidKeyType,
335 YieldFromInvalidSendType,
336 YieldFromInvalidValueType,
337 YieldFromNonIterable,
338 YieldOutsideFunction,
339}
340
341impl IssueCode {
342 #[must_use]
343 pub fn as_str(&self) -> &'static str {
344 match self {
345 Self::AbstractClassUsedAsAttribute => "abstract-class-used-as-attribute",
346 Self::AbstractInstantiation => "abstract-instantiation",
347 Self::AlwaysMatchingSwitchCase => "always-matching-switch-case",
348 Self::AmbiguousClassLikeConstantAccess => "ambiguous-class-like-constant-access",
349 Self::AmbiguousInstantiationTarget => "ambiguous-instantiation-target",
350 Self::AmbiguousObjectMethodAccess => "ambiguous-object-method-access",
351 Self::AmbiguousObjectPropertyAccess => "ambiguous-object-property-access",
352 Self::ArrayAppendInReadContext => "array-append-in-read-context",
353 Self::ArrayAppendOverflow => "array-append-overflow",
354 Self::ArrayToStringConversion => "array-to-string-conversion",
355 Self::AssignmentToConstant => "assignment-to-constant",
356 Self::AssignmentToThis => "assignment-to-this",
357 Self::AttributeNotRepeatable => "attribute-not-repeatable",
358 Self::AvoidCatchingError => "avoid-catching-error",
359 Self::BackedPropertyReferenceHook => "backed-property-reference-hook",
360 Self::CatchTypeNotThrowable => "catch-type-not-throwable",
361 Self::ClassMustBeFinal => "class-must-be-final",
362 Self::ClassNotMarkedAsAttribute => "class-not-marked-as-attribute",
363 Self::CloneInsideLoop => "clone-inside-loop",
364 Self::ConditionIsTooComplex => "condition-is-too-complex",
365 Self::ConflictingReferenceConstraint => "conflicting-reference-constraint",
366 Self::ConflictingTemplateEqualityBounds => "conflicting-template-equality-bounds",
367 Self::DeprecatedClass => "deprecated-class",
368 Self::DeprecatedClosure => "deprecated-closure",
369 Self::DeprecatedConstant => "deprecated-constant",
370 Self::DeprecatedFeature => "deprecated-feature",
371 Self::DeprecatedFunction => "deprecated-function",
372 Self::DeprecatedMethod => "deprecated-method",
373 Self::DeprecatedTrait => "deprecated-trait",
374 Self::DirectTraitConstantAccess => "direct-trait-constant-access",
375 Self::DocblockParameterNarrowing => "docblock-parameter-narrowing",
376 Self::DocblockTypeMismatch => "docblock-type-mismatch",
377 Self::DuplicateArrayKey => "duplicate-array-key",
378 Self::DuplicateCaughtType => "duplicate-caught-type",
379 Self::DuplicateClosureUseVariable => "duplicate-closure-use-variable",
380 Self::DuplicateDefinition => "duplicate-definition",
381 Self::DuplicateEnumCaseValue => "duplicate-enum-case-value",
382 Self::DuplicateNamedArgument => "duplicate-named-argument",
383 Self::DuplicateSwitchCase => "duplicate-switch-case",
384 Self::DynamicStaticMethodCall => "dynamic-static-method-call",
385 Self::EmptyMatchExpression => "empty-match-expression",
386 Self::EnumInstantiation => "enum-instantiation",
387 Self::EnumIteration => "enum-iteration",
388 Self::ExcessTemplateParameter => "excess-template-parameter",
389 Self::ExperimentalUsage => "experimental-usage",
390 Self::ExpressionIsTooComplex => "expression-is-too-complex",
391 Self::ExtendFinalClass => "extend-final-class",
392 Self::FalsableReturnStatement => "falsable-return-statement",
393 Self::FalseArgument => "false-argument",
394 Self::FalseArrayAccess => "false-array-access",
395 Self::FalseIterator => "false-iterator",
396 Self::FalseOperand => "false-operand",
397 Self::GenericObjectIteration => "generic-object-iteration",
398 Self::HiddenGeneratorReturn => "hidden-generator-return",
399 Self::ImplicitResourceToStringCast => "implicit-resource-to-string-cast",
400 Self::ImplicitToStringCast => "implicit-to-string-cast",
401 Self::ImpossibleArrayAccess => "impossible-array-access",
402 Self::ImpossibleArrayAssignment => "impossible-array-assignment",
403 Self::ImpossibleAssignment => "impossible-assignment",
404 Self::ImpossibleCondition => "impossible-condition",
405 Self::ImpossibleKeyCheck => "impossible-key-check",
406 Self::ImpossibleNonnullEntryCheck => "impossible-nonnull-entry-check",
407 Self::ImpossibleNullTypeComparison => "impossible-null-type-comparison",
408 Self::ImpossibleTypeComparison => "impossible-type-comparison",
409 Self::ImpreciseType => "imprecise-type",
410 Self::ImpureConstruct => "impure-construct",
411 Self::ImpureStaticVariable => "impure-static-variable",
412 Self::IncompatibleConstantAccess => "incompatible-constant-access",
413 Self::IncompatibleConstantOverride => "incompatible-constant-override",
414 Self::IncompatibleConstantType => "incompatible-constant-type",
415 Self::IncompatibleConstantVisibility => "incompatible-constant-visibility",
416 Self::IncompatibleParameterCount => "incompatible-parameter-count",
417 Self::IncompatibleParameterName => "incompatible-parameter-name",
418 Self::IncompatibleParameterType => "incompatible-parameter-type",
419 Self::IncompatiblePropertyAccess => "incompatible-property-access",
420 Self::IncompatiblePropertyDefault => "incompatible-property-default",
421 Self::IncompatiblePropertyHookParameterType => "incompatible-property-hook-parameter-type",
422 Self::IncompatiblePropertyHookSignature => "incompatible-property-hook-signature",
423 Self::IncompatiblePropertyOverride => "incompatible-property-override",
424 Self::IncompatiblePropertyReadonly => "incompatible-property-readonly",
425 Self::IncompatiblePropertyStatic => "incompatible-property-static",
426 Self::IncompatiblePropertyType => "incompatible-property-type",
427 Self::IncompatiblePropertyVisibility => "incompatible-property-visibility",
428 Self::IncompatibleReadonlyModifier => "incompatible-readonly-modifier",
429 Self::IncompatibleReturnType => "incompatible-return-type",
430 Self::IncompatibleStaticModifier => "incompatible-static-modifier",
431 Self::IncompatibleTemplateLowerBound => "incompatible-template-lower-bound",
432 Self::IncompatibleVisibility => "incompatible-visibility",
433 Self::InconsistentTemplate => "inconsistent-template",
434 Self::IncorrectClassLikeCasing => "incorrect-class-like-casing",
435 Self::IncorrectFunctionCasing => "incorrect-function-casing",
436 Self::InterfaceInstantiation => "interface-instantiation",
437 Self::InvalidArgument => "invalid-argument",
438 Self::InvalidArrayAccess => "invalid-array-access",
439 Self::InvalidArrayAccessAssignmentValue => "invalid-array-access-assignment-value",
440 Self::InvalidArrayElement => "invalid-array-element",
441 Self::InvalidArrayElementKey => "invalid-array-element-key",
442 Self::InvalidArrayIndex => "invalid-array-index",
443 Self::InvalidAssignment => "invalid-assignment",
444 Self::InvalidAttributeTarget => "invalid-attribute-target",
445 Self::InvalidBreak => "invalid-break",
446 Self::InvalidCallable => "invalid-callable",
447 Self::InvalidCatchType => "invalid-catch-type",
448 Self::InvalidCatchTypeNotClassOrInterface => "invalid-catch-type-not-class-or-interface",
449 Self::InvalidClassConstantOnString => "invalid-class-constant-on-string",
450 Self::InvalidClassStringExpression => "invalid-class-string-expression",
451 Self::InvalidClone => "invalid-clone",
452 Self::InvalidConstantSelector => "invalid-constant-selector",
453 Self::InvalidConstantValue => "invalid-constant-value",
454 Self::InvalidContinue => "invalid-continue",
455 Self::InvalidDestructuringSource => "invalid-destructuring-source",
456 Self::InvalidDocblock => "invalid-docblock",
457 Self::InvalidEnumCaseValue => "invalid-enum-case-value",
458 Self::InvalidExtend => "invalid-extend",
459 Self::InvalidForeachKey => "invalid-foreach-key",
460 Self::InvalidForeachValue => "invalid-foreach-value",
461 Self::InvalidGeneratorReturnType => "invalid-generator-return-type",
462 Self::InvalidGlobal => "invalid-global",
463 Self::InvalidImplement => "invalid-implement",
464 Self::InvalidIssetExpression => "invalid-isset-expression",
465 Self::InvalidIterator => "invalid-iterator",
466 Self::InvalidMemberSelector => "invalid-member-selector",
467 Self::InvalidMethodAccess => "invalid-method-access",
468 Self::InvalidNamedArgument => "invalid-named-argument",
469 Self::InvalidOperand => "invalid-operand",
470 Self::InvalidOverrideAttribute => "invalid-override-attribute",
471 Self::InvalidParameterDefaultValue => "invalid-parameter-default-value",
472 Self::InvalidParentType => "invalid-parent-type",
473 Self::InvalidPassByReference => "invalid-pass-by-reference",
474 Self::InvalidPropertyAccess => "invalid-property-access",
475 Self::InvalidPropertyAssignmentValue => "invalid-property-assignment-value",
476 Self::InvalidPropertyDefaultValue => "invalid-property-default-value",
477 Self::InvalidPropertyRead => "invalid-property-read",
478 Self::InvalidPropertyWrite => "invalid-property-write",
479 Self::InvalidReturnStatement => "invalid-return-statement",
480 Self::InvalidScopeKeywordContext => "invalid-scope-keyword-context",
481 Self::InvalidStaticMethodAccess => "invalid-static-method-access",
482 Self::InvalidStaticMethodCall => "invalid-static-method-call",
483 Self::InvalidStaticPropertyAccess => "invalid-static-property-access",
484 Self::InvalidTemplateParameter => "invalid-template-parameter",
485 Self::InvalidThrow => "invalid-throw",
486 Self::InvalidTraitAliasModifier => "invalid-trait-alias-modifier",
487 Self::InvalidTraitUse => "invalid-trait-use",
488 Self::InvalidTypeCast => "invalid-type-cast",
489 Self::InvalidUnset => "invalid-unset",
490 Self::InvalidYieldKeyType => "invalid-yield-key-type",
491 Self::InvalidYieldValueType => "invalid-yield-value-type",
492 Self::LessSpecificArgument => "less-specific-argument",
493 Self::LessSpecificNestedArgumentType => "less-specific-nested-argument-type",
494 Self::LessSpecificNestedReturnStatement => "less-specific-nested-return-statement",
495 Self::LessSpecificReturnStatement => "less-specific-return-statement",
496 Self::ListDestructureNegativeKey => "list-destructure-negative-key",
497 Self::ListDestructureStringKey => "list-destructure-string-key",
498 Self::ListUsedInReadContext => "list-used-in-read-context",
499 Self::MatchArmAlwaysTrue => "match-arm-always-true",
500 Self::MatchDefaultArmAlwaysExecuted => "match-default-arm-always-executed",
501 Self::MatchExpressionOnlyDefaultArm => "match-expression-only-default-arm",
502 Self::MatchNotExhaustive => "match-not-exhaustive",
503 Self::MatchSubjectTypeIsNever => "match-subject-type-is-never",
504 Self::MethodAccessOnNull => "method-access-on-null",
505 Self::MismatchedArrayIndex => "mismatched-array-index",
506 Self::MissingApiOrInternal => "missing-api-or-internal",
507 Self::MissingConstantType => "missing-constant-type",
508 Self::MissingConstructor => "missing-constructor",
509 Self::MissingMagicMethod => "missing-magic-method",
510 Self::MissingOverrideAttribute => "missing-override-attribute",
511 Self::MissingParameterType => "missing-parameter-type",
512 Self::MissingPropertyType => "missing-property-type",
513 Self::MissingRequiredInterface => "missing-required-interface",
514 Self::MissingRequiredParent => "missing-required-parent",
515 Self::MissingReturnStatement => "missing-return-statement",
516 Self::MissingReturnType => "missing-return-type",
517 Self::MissingTemplateParameter => "missing-template-parameter",
518 Self::MixedArgument => "mixed-argument",
519 Self::MixedArrayAccess => "mixed-array-access",
520 Self::MixedArrayAssignment => "mixed-array-assignment",
521 Self::MixedArrayIndex => "mixed-array-index",
522 Self::MixedAssignment => "mixed-assignment",
523 Self::MixedClone => "mixed-clone",
524 Self::MixedDestructuringShape => "mixed-destructuring-shape",
525 Self::MixedMethodAccess => "mixed-method-access",
526 Self::MixedOperand => "mixed-operand",
527 Self::MixedPropertyAccess => "mixed-property-access",
528 Self::MixedPropertyTypeCoercion => "mixed-property-type-coercion",
529 Self::MixedReturnStatement => "mixed-return-statement",
530 Self::NameAlreadyInUse => "name-already-in-use",
531 Self::NamedArgumentAfterPositional => "named-argument-after-positional",
532 Self::NamedArgumentNotAllowed => "named-argument-not-allowed",
533 Self::NamedArgumentOverridesPositional => "named-argument-overrides-positional",
534 Self::NeverMatchingSwitchCase => "never-matching-switch-case",
535 Self::NeverReturn => "never-return",
536 Self::NoValidCatchTypeFound => "no-valid-catch-type-found",
537 Self::NoValue => "no-value",
538 Self::NonClassUsedAsAttribute => "non-class-used-as-attribute",
539 Self::NonDocumentedConstant => "non-documented-constant",
540 Self::NonDocumentedMethod => "non-documented-method",
541 Self::NonDocumentedProperty => "non-documented-property",
542 Self::NonExistentAttributeClass => "non-existent-attribute-class",
543 Self::NonExistentCatchType => "non-existent-catch-type",
544 Self::NonExistentClass => "non-existent-class",
545 Self::NonExistentClassConstant => "non-existent-class-constant",
546 Self::NonExistentClassLike => "non-existent-class-like",
547 Self::NonExistentConstant => "non-existent-constant",
548 Self::NonExistentFunction => "non-existent-function",
549 Self::NonExistentMethod => "non-existent-method",
550 Self::NonExistentProperty => "non-existent-property",
551 Self::NonExistentUseImport => "non-existent-use-import",
552 Self::NonIterableObjectIteration => "non-iterable-object-iteration",
553 Self::NonStaticAbstractImplementation => "non-static-abstract-implementation",
554 Self::NullArgument => "null-argument",
555 Self::NullArrayAccess => "null-array-access",
556 Self::NullArrayIndex => "null-array-index",
557 Self::NullDestructuringSource => "null-destructuring-source",
558 Self::NullIterator => "null-iterator",
559 Self::NullOperand => "null-operand",
560 Self::NullPropertyAccess => "null-property-access",
561 Self::NullableReturnStatement => "nullable-return-statement",
562 Self::OverlyWideReturnType => "overly-wide-return-type",
563 Self::OverrideFinalConstant => "override-final-constant",
564 Self::OverrideFinalMethod => "override-final-method",
565 Self::OverrideFinalProperty => "override-final-property",
566 Self::OverrideFinalPropertyHook => "override-final-property-hook",
567 Self::ParadoxicalCondition => "paradoxical-condition",
568 Self::ParentOutsideClassScope => "parent-outside-class-scope",
569 Self::PossibleMethodAccessOnNull => "possible-method-access-on-null",
570 Self::PossiblyArrayAppendOverflow => "possibly-array-append-overflow",
571 Self::PossiblyFalseArgument => "possibly-false-argument",
572 Self::PossiblyFalseArrayAccess => "possibly-false-array-access",
573 Self::PossiblyFalseIterator => "possibly-false-iterator",
574 Self::PossiblyFalseOperand => "possibly-false-operand",
575 Self::PossiblyInvalidArgument => "possibly-invalid-argument",
576 Self::PossiblyInvalidArrayAccess => "possibly-invalid-array-access",
577 Self::PossiblyInvalidClone => "possibly-invalid-clone",
578 Self::PossiblyInvalidIterator => "possibly-invalid-iterator",
579 Self::PossiblyInvalidOperand => "possibly-invalid-operand",
580 Self::PossiblyInvalidPropertyWrite => "possibly-invalid-property-write",
581 Self::PossiblyNonExistentMethod => "possibly-non-existent-method",
582 Self::PossiblyNonExistentProperty => "possibly-non-existent-property",
583 Self::PossiblyNullArgument => "possibly-null-argument",
584 Self::PossiblyNullArrayAccess => "possibly-null-array-access",
585 Self::PossiblyNullArrayIndex => "possibly-null-array-index",
586 Self::PossiblyNullDestructuringSource => "possibly-null-destructuring-source",
587 Self::PossiblyNullIterator => "possibly-null-iterator",
588 Self::PossiblyNullOperand => "possibly-null-operand",
589 Self::PossiblyNullPropertyAccess => "possibly-null-property-access",
590 Self::PossiblyStaticAccessOnInterface => "possibly-static-access-on-interface",
591 Self::PossiblyUndefinedArrayIndex => "possibly-undefined-array-index",
592 Self::PossiblyUndefinedIntArrayIndex => "possibly-undefined-int-array-index",
593 Self::PossiblyUndefinedStringArrayIndex => "possibly-undefined-string-array-index",
594 Self::PossiblyUndefinedVariable => "possibly-undefined-variable",
595 Self::PropertyTypeCoercion => "property-type-coercion",
596 Self::PsalmTrace => "psalm-trace",
597 Self::RedundantCast => "redundant-cast",
598 Self::RedundantComparison => "redundant-comparison",
599 Self::RedundantCondition => "redundant-condition",
600 Self::RedundantDocblockType => "redundant-docblock-type",
601 Self::RedundantIssetCheck => "redundant-isset-check",
602 Self::RedundantKeyCheck => "redundant-key-check",
603 Self::RedundantLogicalOperation => "redundant-logical-operation",
604 Self::RedundantNonnullEntryCheck => "redundant-nonnull-entry-check",
605 Self::RedundantNonnullTypeComparison => "redundant-nonnull-type-comparison",
606 Self::RedundantNullCoalesce => "redundant-null-coalesce",
607 Self::RedundantNullsafeOperator => "redundant-nullsafe-operator",
608 Self::RedundantTypeComparison => "redundant-type-comparison",
609 Self::ReferenceConstraintViolation => "reference-constraint-violation",
610 Self::ReferenceReusedFromConfusingScope => "reference-reused-from-confusing-scope",
611 Self::ReferenceToUndefinedVariable => "reference-to-undefined-variable",
612 Self::SelfOutsideClassScope => "self-outside-class-scope",
613 Self::SideEffectsInCondition => "side-effects-in-condition",
614 Self::SkipInKeyedDestructuring => "skip-in-keyed-destructuring",
615 Self::SpreadInDestructuring => "spread-in-destructuring",
616 Self::StaticAccessOnInterface => "static-access-on-interface",
617 Self::StaticOutsideClassScope => "static-outside-class-scope",
618 Self::StringConstantSelector => "string-constant-selector",
619 Self::StringMemberSelector => "string-member-selector",
620 Self::TemplateConstraintViolation => "template-constraint-violation",
621 Self::TooFewArguments => "too-few-arguments",
622 Self::TooManyArguments => "too-many-arguments",
623 Self::TraitConstantOverride => "trait-constant-override",
624 Self::TraitInstantiation => "trait-instantiation",
625 Self::TypeConfirmation => "type-confirmation",
626 Self::TypeInspection => "type-inspection",
627 Self::UnavailableClassConstant => "unavailable-class-constant",
628 Self::UnavailableClassLike => "unavailable-class-like",
629 Self::UnavailableConstant => "unavailable-constant",
630 Self::UnavailableEnumCase => "unavailable-enum-case",
631 Self::UnavailableFunction => "unavailable-function",
632 Self::UnavailableMethod => "unavailable-method",
633 Self::UnavailableProperty => "unavailable-property",
634 Self::UndefinedIntArrayIndex => "undefined-int-array-index",
635 Self::UndefinedStringArrayIndex => "undefined-string-array-index",
636 Self::UndefinedVariable => "undefined-variable",
637 Self::UndefinedVariableInClosureUse => "undefined-variable-in-closure-use",
638 Self::UnevaluatedCode => "unevaluated-code",
639 Self::UnhandledThrownType => "unhandled-thrown-type",
640 Self::UnimplementedAbstractMethod => "unimplemented-abstract-method",
641 Self::UnimplementedAbstractPropertyHook => "unimplemented-abstract-property-hook",
642 Self::UninitializedProperty => "uninitialized-property",
643 Self::UnknownClassInstantiation => "unknown-class-instantiation",
644 Self::UnknownConstantSelectorType => "unknown-constant-selector-type",
645 Self::UnknownIteratorType => "unknown-iterator-type",
646 Self::UnknownMatchSubjectType => "unknown-match-subject-type",
647 Self::UnknownMemberSelectorType => "unknown-member-selector-type",
648 Self::UnknownYieldFromIteratorType => "unknown-yield-from-iterator-type",
649 Self::UnreachableElseClause => "unreachable-else-clause",
650 Self::UnreachableMatchArm => "unreachable-match-arm",
651 Self::UnreachableMatchDefaultArm => "unreachable-match-default-arm",
652 Self::UnreachableSwitchCase => "unreachable-switch-case",
653 Self::UnreachableSwitchDefault => "unreachable-switch-default",
654 Self::UnresolvableClassConstant => "unresolvable-class-constant",
655 Self::UnsafeInstantiation => "unsafe-instantiation",
656 Self::UnusedFunctionCall => "unused-function-call",
657 Self::UnusedMethod => "unused-method",
658 Self::UnusedMethodCall => "unused-method-call",
659 Self::UnusedParameter => "unused-parameter",
660 Self::UnusedProperty => "unused-property",
661 Self::UnusedStatement => "unused-statement",
662 Self::UnusedTemplateParameter => "unused-template-parameter",
663 Self::UselessControlFlow => "useless-control-flow",
664 Self::WhereConstraintViolation => "where-constraint-violation",
665 Self::WriteOnlyProperty => "write-only-property",
666 Self::YieldFromInvalidKeyType => "yield-from-invalid-key-type",
667 Self::YieldFromInvalidSendType => "yield-from-invalid-send-type",
668 Self::YieldFromInvalidValueType => "yield-from-invalid-value-type",
669 Self::YieldFromNonIterable => "yield-from-non-iterable",
670 Self::YieldOutsideFunction => "yield-outside-function",
671 }
672 }
673
674 #[must_use]
675 pub fn as_u16(&self) -> u16 {
676 *self as u16
677 }
678
679 #[must_use]
680 pub fn all() -> &'static [IssueCode] {
681 &[
682 Self::AbstractClassUsedAsAttribute,
683 Self::AbstractInstantiation,
684 Self::AlwaysMatchingSwitchCase,
685 Self::AmbiguousClassLikeConstantAccess,
686 Self::AmbiguousInstantiationTarget,
687 Self::AmbiguousObjectMethodAccess,
688 Self::AmbiguousObjectPropertyAccess,
689 Self::ArrayAppendInReadContext,
690 Self::ArrayAppendOverflow,
691 Self::ArrayToStringConversion,
692 Self::AssignmentToConstant,
693 Self::AssignmentToThis,
694 Self::AttributeNotRepeatable,
695 Self::AvoidCatchingError,
696 Self::BackedPropertyReferenceHook,
697 Self::CatchTypeNotThrowable,
698 Self::ClassMustBeFinal,
699 Self::ClassNotMarkedAsAttribute,
700 Self::CloneInsideLoop,
701 Self::ConditionIsTooComplex,
702 Self::ConflictingReferenceConstraint,
703 Self::ConflictingTemplateEqualityBounds,
704 Self::DeprecatedClass,
705 Self::DeprecatedClosure,
706 Self::DeprecatedConstant,
707 Self::DeprecatedFeature,
708 Self::DeprecatedFunction,
709 Self::DeprecatedMethod,
710 Self::DeprecatedTrait,
711 Self::DirectTraitConstantAccess,
712 Self::DocblockParameterNarrowing,
713 Self::DocblockTypeMismatch,
714 Self::DuplicateArrayKey,
715 Self::DuplicateCaughtType,
716 Self::DuplicateClosureUseVariable,
717 Self::DuplicateDefinition,
718 Self::DuplicateEnumCaseValue,
719 Self::DuplicateNamedArgument,
720 Self::DuplicateSwitchCase,
721 Self::DynamicStaticMethodCall,
722 Self::EmptyMatchExpression,
723 Self::EnumInstantiation,
724 Self::EnumIteration,
725 Self::ExcessTemplateParameter,
726 Self::ExperimentalUsage,
727 Self::ExpressionIsTooComplex,
728 Self::ExtendFinalClass,
729 Self::FalsableReturnStatement,
730 Self::FalseArgument,
731 Self::FalseArrayAccess,
732 Self::FalseIterator,
733 Self::FalseOperand,
734 Self::GenericObjectIteration,
735 Self::HiddenGeneratorReturn,
736 Self::ImplicitResourceToStringCast,
737 Self::ImplicitToStringCast,
738 Self::ImpossibleArrayAccess,
739 Self::ImpossibleArrayAssignment,
740 Self::ImpossibleAssignment,
741 Self::ImpossibleCondition,
742 Self::ImpossibleKeyCheck,
743 Self::ImpossibleNonnullEntryCheck,
744 Self::ImpossibleNullTypeComparison,
745 Self::ImpossibleTypeComparison,
746 Self::ImpreciseType,
747 Self::ImpureConstruct,
748 Self::ImpureStaticVariable,
749 Self::IncompatibleConstantAccess,
750 Self::IncompatibleConstantOverride,
751 Self::IncompatibleConstantType,
752 Self::IncompatibleConstantVisibility,
753 Self::IncompatibleParameterCount,
754 Self::IncompatibleParameterName,
755 Self::IncompatibleParameterType,
756 Self::IncompatiblePropertyAccess,
757 Self::IncompatiblePropertyDefault,
758 Self::IncompatiblePropertyHookParameterType,
759 Self::IncompatiblePropertyHookSignature,
760 Self::IncompatiblePropertyOverride,
761 Self::IncompatiblePropertyReadonly,
762 Self::IncompatiblePropertyStatic,
763 Self::IncompatiblePropertyType,
764 Self::IncompatiblePropertyVisibility,
765 Self::IncompatibleReadonlyModifier,
766 Self::IncompatibleReturnType,
767 Self::IncompatibleStaticModifier,
768 Self::IncompatibleTemplateLowerBound,
769 Self::IncompatibleVisibility,
770 Self::InconsistentTemplate,
771 Self::IncorrectClassLikeCasing,
772 Self::IncorrectFunctionCasing,
773 Self::InterfaceInstantiation,
774 Self::InvalidArgument,
775 Self::InvalidArrayAccess,
776 Self::InvalidArrayAccessAssignmentValue,
777 Self::InvalidArrayElement,
778 Self::InvalidArrayElementKey,
779 Self::InvalidArrayIndex,
780 Self::InvalidAssignment,
781 Self::InvalidAttributeTarget,
782 Self::InvalidBreak,
783 Self::InvalidCallable,
784 Self::InvalidCatchType,
785 Self::InvalidCatchTypeNotClassOrInterface,
786 Self::InvalidClassConstantOnString,
787 Self::InvalidClassStringExpression,
788 Self::InvalidClone,
789 Self::InvalidConstantSelector,
790 Self::InvalidConstantValue,
791 Self::InvalidContinue,
792 Self::InvalidDestructuringSource,
793 Self::InvalidDocblock,
794 Self::InvalidEnumCaseValue,
795 Self::InvalidExtend,
796 Self::InvalidForeachKey,
797 Self::InvalidForeachValue,
798 Self::InvalidGeneratorReturnType,
799 Self::InvalidGlobal,
800 Self::InvalidImplement,
801 Self::InvalidIssetExpression,
802 Self::InvalidIterator,
803 Self::InvalidMemberSelector,
804 Self::InvalidMethodAccess,
805 Self::InvalidNamedArgument,
806 Self::InvalidOperand,
807 Self::InvalidOverrideAttribute,
808 Self::InvalidParameterDefaultValue,
809 Self::InvalidParentType,
810 Self::InvalidPassByReference,
811 Self::InvalidPropertyAccess,
812 Self::InvalidPropertyAssignmentValue,
813 Self::InvalidPropertyDefaultValue,
814 Self::InvalidPropertyRead,
815 Self::InvalidPropertyWrite,
816 Self::InvalidReturnStatement,
817 Self::InvalidScopeKeywordContext,
818 Self::InvalidStaticMethodAccess,
819 Self::InvalidStaticMethodCall,
820 Self::InvalidStaticPropertyAccess,
821 Self::InvalidTemplateParameter,
822 Self::InvalidThrow,
823 Self::InvalidTraitAliasModifier,
824 Self::InvalidTraitUse,
825 Self::InvalidTypeCast,
826 Self::InvalidUnset,
827 Self::InvalidYieldKeyType,
828 Self::InvalidYieldValueType,
829 Self::LessSpecificArgument,
830 Self::LessSpecificNestedArgumentType,
831 Self::LessSpecificNestedReturnStatement,
832 Self::LessSpecificReturnStatement,
833 Self::ListDestructureNegativeKey,
834 Self::ListDestructureStringKey,
835 Self::ListUsedInReadContext,
836 Self::MatchArmAlwaysTrue,
837 Self::MatchDefaultArmAlwaysExecuted,
838 Self::MatchExpressionOnlyDefaultArm,
839 Self::MatchNotExhaustive,
840 Self::MatchSubjectTypeIsNever,
841 Self::MethodAccessOnNull,
842 Self::MismatchedArrayIndex,
843 Self::MissingApiOrInternal,
844 Self::MissingConstantType,
845 Self::MissingConstructor,
846 Self::MissingMagicMethod,
847 Self::MissingOverrideAttribute,
848 Self::MissingParameterType,
849 Self::MissingPropertyType,
850 Self::MissingRequiredInterface,
851 Self::MissingRequiredParent,
852 Self::MissingReturnStatement,
853 Self::MissingReturnType,
854 Self::MissingTemplateParameter,
855 Self::MixedArgument,
856 Self::MixedArrayAccess,
857 Self::MixedArrayAssignment,
858 Self::MixedArrayIndex,
859 Self::MixedAssignment,
860 Self::MixedClone,
861 Self::MixedDestructuringShape,
862 Self::MixedMethodAccess,
863 Self::MixedOperand,
864 Self::MixedPropertyAccess,
865 Self::MixedPropertyTypeCoercion,
866 Self::MixedReturnStatement,
867 Self::NameAlreadyInUse,
868 Self::NamedArgumentAfterPositional,
869 Self::NamedArgumentNotAllowed,
870 Self::NamedArgumentOverridesPositional,
871 Self::NeverMatchingSwitchCase,
872 Self::NeverReturn,
873 Self::NoValidCatchTypeFound,
874 Self::NoValue,
875 Self::NonClassUsedAsAttribute,
876 Self::NonDocumentedConstant,
877 Self::NonDocumentedMethod,
878 Self::NonDocumentedProperty,
879 Self::NonExistentAttributeClass,
880 Self::NonExistentCatchType,
881 Self::NonExistentClass,
882 Self::NonExistentClassConstant,
883 Self::NonExistentClassLike,
884 Self::NonExistentConstant,
885 Self::NonExistentFunction,
886 Self::NonExistentMethod,
887 Self::NonExistentProperty,
888 Self::NonExistentUseImport,
889 Self::NonIterableObjectIteration,
890 Self::NonStaticAbstractImplementation,
891 Self::NullArgument,
892 Self::NullArrayAccess,
893 Self::NullArrayIndex,
894 Self::NullDestructuringSource,
895 Self::NullIterator,
896 Self::NullOperand,
897 Self::NullPropertyAccess,
898 Self::NullableReturnStatement,
899 Self::OverlyWideReturnType,
900 Self::OverrideFinalConstant,
901 Self::OverrideFinalMethod,
902 Self::OverrideFinalProperty,
903 Self::OverrideFinalPropertyHook,
904 Self::ParadoxicalCondition,
905 Self::ParentOutsideClassScope,
906 Self::PossibleMethodAccessOnNull,
907 Self::PossiblyArrayAppendOverflow,
908 Self::PossiblyFalseArgument,
909 Self::PossiblyFalseArrayAccess,
910 Self::PossiblyFalseIterator,
911 Self::PossiblyFalseOperand,
912 Self::PossiblyInvalidArgument,
913 Self::PossiblyInvalidArrayAccess,
914 Self::PossiblyInvalidClone,
915 Self::PossiblyInvalidIterator,
916 Self::PossiblyInvalidOperand,
917 Self::PossiblyInvalidPropertyWrite,
918 Self::PossiblyNonExistentMethod,
919 Self::PossiblyNonExistentProperty,
920 Self::PossiblyNullArgument,
921 Self::PossiblyNullArrayAccess,
922 Self::PossiblyNullArrayIndex,
923 Self::PossiblyNullDestructuringSource,
924 Self::PossiblyNullIterator,
925 Self::PossiblyNullOperand,
926 Self::PossiblyNullPropertyAccess,
927 Self::PossiblyStaticAccessOnInterface,
928 Self::PossiblyUndefinedArrayIndex,
929 Self::PossiblyUndefinedIntArrayIndex,
930 Self::PossiblyUndefinedStringArrayIndex,
931 Self::PossiblyUndefinedVariable,
932 Self::PropertyTypeCoercion,
933 Self::PsalmTrace,
934 Self::RedundantCast,
935 Self::RedundantComparison,
936 Self::RedundantCondition,
937 Self::RedundantDocblockType,
938 Self::RedundantIssetCheck,
939 Self::RedundantKeyCheck,
940 Self::RedundantLogicalOperation,
941 Self::RedundantNonnullEntryCheck,
942 Self::RedundantNonnullTypeComparison,
943 Self::RedundantNullCoalesce,
944 Self::RedundantNullsafeOperator,
945 Self::RedundantTypeComparison,
946 Self::ReferenceConstraintViolation,
947 Self::ReferenceReusedFromConfusingScope,
948 Self::ReferenceToUndefinedVariable,
949 Self::SelfOutsideClassScope,
950 Self::SideEffectsInCondition,
951 Self::SkipInKeyedDestructuring,
952 Self::SpreadInDestructuring,
953 Self::StaticAccessOnInterface,
954 Self::StaticOutsideClassScope,
955 Self::StringConstantSelector,
956 Self::StringMemberSelector,
957 Self::TemplateConstraintViolation,
958 Self::TooFewArguments,
959 Self::TooManyArguments,
960 Self::TraitConstantOverride,
961 Self::TraitInstantiation,
962 Self::TypeConfirmation,
963 Self::TypeInspection,
964 Self::UnavailableClassConstant,
965 Self::UnavailableClassLike,
966 Self::UnavailableConstant,
967 Self::UnavailableEnumCase,
968 Self::UnavailableFunction,
969 Self::UnavailableMethod,
970 Self::UnavailableProperty,
971 Self::UndefinedIntArrayIndex,
972 Self::UndefinedStringArrayIndex,
973 Self::UndefinedVariable,
974 Self::UndefinedVariableInClosureUse,
975 Self::UnevaluatedCode,
976 Self::UnhandledThrownType,
977 Self::UnimplementedAbstractMethod,
978 Self::UnimplementedAbstractPropertyHook,
979 Self::UninitializedProperty,
980 Self::UnknownClassInstantiation,
981 Self::UnknownConstantSelectorType,
982 Self::UnknownIteratorType,
983 Self::UnknownMatchSubjectType,
984 Self::UnknownMemberSelectorType,
985 Self::UnknownYieldFromIteratorType,
986 Self::UnreachableElseClause,
987 Self::UnreachableMatchArm,
988 Self::UnreachableMatchDefaultArm,
989 Self::UnreachableSwitchCase,
990 Self::UnreachableSwitchDefault,
991 Self::UnresolvableClassConstant,
992 Self::UnsafeInstantiation,
993 Self::UnusedFunctionCall,
994 Self::UnusedMethod,
995 Self::UnusedMethodCall,
996 Self::UnusedParameter,
997 Self::UnusedProperty,
998 Self::UnusedStatement,
999 Self::UnusedTemplateParameter,
1000 Self::UselessControlFlow,
1001 Self::WhereConstraintViolation,
1002 Self::WriteOnlyProperty,
1003 Self::YieldFromInvalidKeyType,
1004 Self::YieldFromInvalidSendType,
1005 Self::YieldFromInvalidValueType,
1006 Self::YieldFromNonIterable,
1007 Self::YieldOutsideFunction,
1008 ]
1009 }
1010}
1011
1012impl std::str::FromStr for IssueCode {
1013 type Err = &'static str;
1014
1015 fn from_str(s: &str) -> Result<Self, Self::Err> {
1016 match s {
1017 "abstract-class-used-as-attribute" => Ok(Self::AbstractClassUsedAsAttribute),
1018 "abstract-instantiation" => Ok(Self::AbstractInstantiation),
1019 "always-matching-switch-case" => Ok(Self::AlwaysMatchingSwitchCase),
1020 "ambiguous-class-like-constant-access" => Ok(Self::AmbiguousClassLikeConstantAccess),
1021 "ambiguous-instantiation-target" => Ok(Self::AmbiguousInstantiationTarget),
1022 "ambiguous-object-method-access" => Ok(Self::AmbiguousObjectMethodAccess),
1023 "ambiguous-object-property-access" => Ok(Self::AmbiguousObjectPropertyAccess),
1024 "array-append-in-read-context" => Ok(Self::ArrayAppendInReadContext),
1025 "array-append-overflow" => Ok(Self::ArrayAppendOverflow),
1026 "array-to-string-conversion" => Ok(Self::ArrayToStringConversion),
1027 "assignment-to-constant" => Ok(Self::AssignmentToConstant),
1028 "assignment-to-this" => Ok(Self::AssignmentToThis),
1029 "attribute-not-repeatable" => Ok(Self::AttributeNotRepeatable),
1030 "avoid-catching-error" => Ok(Self::AvoidCatchingError),
1031 "backed-property-reference-hook" => Ok(Self::BackedPropertyReferenceHook),
1032 "catch-type-not-throwable" => Ok(Self::CatchTypeNotThrowable),
1033 "class-must-be-final" => Ok(Self::ClassMustBeFinal),
1034 "class-not-marked-as-attribute" => Ok(Self::ClassNotMarkedAsAttribute),
1035 "clone-inside-loop" => Ok(Self::CloneInsideLoop),
1036 "condition-is-too-complex" => Ok(Self::ConditionIsTooComplex),
1037 "conflicting-reference-constraint" => Ok(Self::ConflictingReferenceConstraint),
1038 "conflicting-template-equality-bounds" => Ok(Self::ConflictingTemplateEqualityBounds),
1039 "deprecated-class" => Ok(Self::DeprecatedClass),
1040 "deprecated-closure" => Ok(Self::DeprecatedClosure),
1041 "deprecated-constant" => Ok(Self::DeprecatedConstant),
1042 "deprecated-feature" => Ok(Self::DeprecatedFeature),
1043 "deprecated-function" => Ok(Self::DeprecatedFunction),
1044 "deprecated-method" => Ok(Self::DeprecatedMethod),
1045 "deprecated-trait" => Ok(Self::DeprecatedTrait),
1046 "direct-trait-constant-access" => Ok(Self::DirectTraitConstantAccess),
1047 "docblock-parameter-narrowing" => Ok(Self::DocblockParameterNarrowing),
1048 "docblock-type-mismatch" => Ok(Self::DocblockTypeMismatch),
1049 "duplicate-array-key" => Ok(Self::DuplicateArrayKey),
1050 "duplicate-caught-type" => Ok(Self::DuplicateCaughtType),
1051 "duplicate-closure-use-variable" => Ok(Self::DuplicateClosureUseVariable),
1052 "duplicate-definition" => Ok(Self::DuplicateDefinition),
1053 "duplicate-enum-case-value" => Ok(Self::DuplicateEnumCaseValue),
1054 "duplicate-named-argument" => Ok(Self::DuplicateNamedArgument),
1055 "duplicate-switch-case" => Ok(Self::DuplicateSwitchCase),
1056 "dynamic-static-method-call" => Ok(Self::DynamicStaticMethodCall),
1057 "empty-match-expression" => Ok(Self::EmptyMatchExpression),
1058 "enum-instantiation" => Ok(Self::EnumInstantiation),
1059 "enum-iteration" => Ok(Self::EnumIteration),
1060 "excess-template-parameter" => Ok(Self::ExcessTemplateParameter),
1061 "experimental-usage" => Ok(Self::ExperimentalUsage),
1062 "expression-is-too-complex" => Ok(Self::ExpressionIsTooComplex),
1063 "extend-final-class" => Ok(Self::ExtendFinalClass),
1064 "falsable-return-statement" => Ok(Self::FalsableReturnStatement),
1065 "false-argument" => Ok(Self::FalseArgument),
1066 "false-array-access" => Ok(Self::FalseArrayAccess),
1067 "false-iterator" => Ok(Self::FalseIterator),
1068 "false-operand" => Ok(Self::FalseOperand),
1069 "generic-object-iteration" => Ok(Self::GenericObjectIteration),
1070 "hidden-generator-return" => Ok(Self::HiddenGeneratorReturn),
1071 "implicit-resource-to-string-cast" => Ok(Self::ImplicitResourceToStringCast),
1072 "implicit-to-string-cast" => Ok(Self::ImplicitToStringCast),
1073 "impossible-array-access" => Ok(Self::ImpossibleArrayAccess),
1074 "impossible-array-assignment" => Ok(Self::ImpossibleArrayAssignment),
1075 "impossible-assignment" => Ok(Self::ImpossibleAssignment),
1076 "impossible-condition" => Ok(Self::ImpossibleCondition),
1077 "impossible-key-check" => Ok(Self::ImpossibleKeyCheck),
1078 "impossible-nonnull-entry-check" => Ok(Self::ImpossibleNonnullEntryCheck),
1079 "impossible-null-type-comparison" => Ok(Self::ImpossibleNullTypeComparison),
1080 "impossible-type-comparison" => Ok(Self::ImpossibleTypeComparison),
1081 "imprecise-type" => Ok(Self::ImpreciseType),
1082 "impure-construct" => Ok(Self::ImpureConstruct),
1083 "impure-static-variable" => Ok(Self::ImpureStaticVariable),
1084 "incompatible-constant-access" => Ok(Self::IncompatibleConstantAccess),
1085 "incompatible-constant-override" => Ok(Self::IncompatibleConstantOverride),
1086 "incompatible-constant-type" => Ok(Self::IncompatibleConstantType),
1087 "incompatible-constant-visibility" => Ok(Self::IncompatibleConstantVisibility),
1088 "incompatible-parameter-count" => Ok(Self::IncompatibleParameterCount),
1089 "incompatible-parameter-name" => Ok(Self::IncompatibleParameterName),
1090 "incompatible-parameter-type" => Ok(Self::IncompatibleParameterType),
1091 "incompatible-property-access" => Ok(Self::IncompatiblePropertyAccess),
1092 "incompatible-property-default" => Ok(Self::IncompatiblePropertyDefault),
1093 "incompatible-property-hook-parameter-type" => Ok(Self::IncompatiblePropertyHookParameterType),
1094 "incompatible-property-hook-signature" => Ok(Self::IncompatiblePropertyHookSignature),
1095 "incompatible-property-override" => Ok(Self::IncompatiblePropertyOverride),
1096 "incompatible-property-readonly" => Ok(Self::IncompatiblePropertyReadonly),
1097 "incompatible-property-static" => Ok(Self::IncompatiblePropertyStatic),
1098 "incompatible-property-type" => Ok(Self::IncompatiblePropertyType),
1099 "incompatible-property-visibility" => Ok(Self::IncompatiblePropertyVisibility),
1100 "incompatible-readonly-modifier" => Ok(Self::IncompatibleReadonlyModifier),
1101 "incompatible-return-type" => Ok(Self::IncompatibleReturnType),
1102 "incompatible-static-modifier" => Ok(Self::IncompatibleStaticModifier),
1103 "incompatible-template-lower-bound" => Ok(Self::IncompatibleTemplateLowerBound),
1104 "incompatible-visibility" => Ok(Self::IncompatibleVisibility),
1105 "inconsistent-template" => Ok(Self::InconsistentTemplate),
1106 "incorrect-class-like-casing" => Ok(Self::IncorrectClassLikeCasing),
1107 "incorrect-function-casing" => Ok(Self::IncorrectFunctionCasing),
1108 "interface-instantiation" => Ok(Self::InterfaceInstantiation),
1109 "invalid-argument" => Ok(Self::InvalidArgument),
1110 "invalid-array-access" => Ok(Self::InvalidArrayAccess),
1111 "invalid-array-access-assignment-value" => Ok(Self::InvalidArrayAccessAssignmentValue),
1112 "invalid-array-element" => Ok(Self::InvalidArrayElement),
1113 "invalid-array-element-key" => Ok(Self::InvalidArrayElementKey),
1114 "invalid-array-index" => Ok(Self::InvalidArrayIndex),
1115 "invalid-assignment" => Ok(Self::InvalidAssignment),
1116 "invalid-attribute-target" => Ok(Self::InvalidAttributeTarget),
1117 "invalid-break" => Ok(Self::InvalidBreak),
1118 "invalid-callable" => Ok(Self::InvalidCallable),
1119 "invalid-catch-type" => Ok(Self::InvalidCatchType),
1120 "invalid-catch-type-not-class-or-interface" => Ok(Self::InvalidCatchTypeNotClassOrInterface),
1121 "invalid-class-constant-on-string" => Ok(Self::InvalidClassConstantOnString),
1122 "invalid-class-string-expression" => Ok(Self::InvalidClassStringExpression),
1123 "invalid-clone" => Ok(Self::InvalidClone),
1124 "invalid-constant-selector" => Ok(Self::InvalidConstantSelector),
1125 "invalid-constant-value" => Ok(Self::InvalidConstantValue),
1126 "invalid-continue" => Ok(Self::InvalidContinue),
1127 "invalid-destructuring-source" => Ok(Self::InvalidDestructuringSource),
1128 "invalid-docblock" => Ok(Self::InvalidDocblock),
1129 "invalid-enum-case-value" => Ok(Self::InvalidEnumCaseValue),
1130 "invalid-extend" => Ok(Self::InvalidExtend),
1131 "invalid-foreach-key" => Ok(Self::InvalidForeachKey),
1132 "invalid-foreach-value" => Ok(Self::InvalidForeachValue),
1133 "invalid-generator-return-type" => Ok(Self::InvalidGeneratorReturnType),
1134 "invalid-global" => Ok(Self::InvalidGlobal),
1135 "invalid-implement" => Ok(Self::InvalidImplement),
1136 "invalid-isset-expression" => Ok(Self::InvalidIssetExpression),
1137 "invalid-iterator" => Ok(Self::InvalidIterator),
1138 "invalid-member-selector" => Ok(Self::InvalidMemberSelector),
1139 "invalid-method-access" => Ok(Self::InvalidMethodAccess),
1140 "invalid-named-argument" => Ok(Self::InvalidNamedArgument),
1141 "invalid-operand" => Ok(Self::InvalidOperand),
1142 "invalid-override-attribute" => Ok(Self::InvalidOverrideAttribute),
1143 "invalid-parameter-default-value" => Ok(Self::InvalidParameterDefaultValue),
1144 "invalid-parent-type" => Ok(Self::InvalidParentType),
1145 "invalid-pass-by-reference" => Ok(Self::InvalidPassByReference),
1146 "invalid-property-access" => Ok(Self::InvalidPropertyAccess),
1147 "invalid-property-assignment-value" => Ok(Self::InvalidPropertyAssignmentValue),
1148 "invalid-property-default-value" => Ok(Self::InvalidPropertyDefaultValue),
1149 "invalid-property-read" => Ok(Self::InvalidPropertyRead),
1150 "invalid-property-write" => Ok(Self::InvalidPropertyWrite),
1151 "invalid-return-statement" => Ok(Self::InvalidReturnStatement),
1152 "invalid-scope-keyword-context" => Ok(Self::InvalidScopeKeywordContext),
1153 "invalid-static-method-access" => Ok(Self::InvalidStaticMethodAccess),
1154 "invalid-static-method-call" => Ok(Self::InvalidStaticMethodCall),
1155 "invalid-static-property-access" => Ok(Self::InvalidStaticPropertyAccess),
1156 "invalid-template-parameter" => Ok(Self::InvalidTemplateParameter),
1157 "invalid-throw" => Ok(Self::InvalidThrow),
1158 "invalid-trait-alias-modifier" => Ok(Self::InvalidTraitAliasModifier),
1159 "invalid-trait-use" => Ok(Self::InvalidTraitUse),
1160 "invalid-type-cast" => Ok(Self::InvalidTypeCast),
1161 "invalid-unset" => Ok(Self::InvalidUnset),
1162 "invalid-yield-key-type" => Ok(Self::InvalidYieldKeyType),
1163 "invalid-yield-value-type" => Ok(Self::InvalidYieldValueType),
1164 "less-specific-argument" => Ok(Self::LessSpecificArgument),
1165 "less-specific-nested-argument-type" => Ok(Self::LessSpecificNestedArgumentType),
1166 "less-specific-nested-return-statement" => Ok(Self::LessSpecificNestedReturnStatement),
1167 "less-specific-return-statement" => Ok(Self::LessSpecificReturnStatement),
1168 "list-destructure-negative-key" => Ok(Self::ListDestructureNegativeKey),
1169 "list-destructure-string-key" => Ok(Self::ListDestructureStringKey),
1170 "list-used-in-read-context" => Ok(Self::ListUsedInReadContext),
1171 "match-arm-always-true" => Ok(Self::MatchArmAlwaysTrue),
1172 "match-default-arm-always-executed" => Ok(Self::MatchDefaultArmAlwaysExecuted),
1173 "match-expression-only-default-arm" => Ok(Self::MatchExpressionOnlyDefaultArm),
1174 "match-not-exhaustive" => Ok(Self::MatchNotExhaustive),
1175 "match-subject-type-is-never" => Ok(Self::MatchSubjectTypeIsNever),
1176 "method-access-on-null" => Ok(Self::MethodAccessOnNull),
1177 "mismatched-array-index" => Ok(Self::MismatchedArrayIndex),
1178 "missing-api-or-internal" => Ok(Self::MissingApiOrInternal),
1179 "missing-constant-type" => Ok(Self::MissingConstantType),
1180 "missing-constructor" => Ok(Self::MissingConstructor),
1181 "missing-magic-method" => Ok(Self::MissingMagicMethod),
1182 "missing-override-attribute" => Ok(Self::MissingOverrideAttribute),
1183 "missing-parameter-type" => Ok(Self::MissingParameterType),
1184 "missing-property-type" => Ok(Self::MissingPropertyType),
1185 "missing-required-interface" => Ok(Self::MissingRequiredInterface),
1186 "missing-required-parent" => Ok(Self::MissingRequiredParent),
1187 "missing-return-statement" => Ok(Self::MissingReturnStatement),
1188 "missing-return-type" => Ok(Self::MissingReturnType),
1189 "missing-template-parameter" => Ok(Self::MissingTemplateParameter),
1190 "mixed-argument" => Ok(Self::MixedArgument),
1191 "mixed-array-access" => Ok(Self::MixedArrayAccess),
1192 "mixed-array-assignment" => Ok(Self::MixedArrayAssignment),
1193 "mixed-array-index" => Ok(Self::MixedArrayIndex),
1194 "mixed-assignment" => Ok(Self::MixedAssignment),
1195 "mixed-clone" => Ok(Self::MixedClone),
1196 "mixed-destructuring-shape" => Ok(Self::MixedDestructuringShape),
1197 "mixed-method-access" => Ok(Self::MixedMethodAccess),
1198 "mixed-operand" => Ok(Self::MixedOperand),
1199 "mixed-property-access" => Ok(Self::MixedPropertyAccess),
1200 "mixed-property-type-coercion" => Ok(Self::MixedPropertyTypeCoercion),
1201 "mixed-return-statement" => Ok(Self::MixedReturnStatement),
1202 "name-already-in-use" => Ok(Self::NameAlreadyInUse),
1203 "named-argument-after-positional" => Ok(Self::NamedArgumentAfterPositional),
1204 "named-argument-not-allowed" => Ok(Self::NamedArgumentNotAllowed),
1205 "named-argument-overrides-positional" => Ok(Self::NamedArgumentOverridesPositional),
1206 "never-matching-switch-case" => Ok(Self::NeverMatchingSwitchCase),
1207 "never-return" => Ok(Self::NeverReturn),
1208 "no-valid-catch-type-found" => Ok(Self::NoValidCatchTypeFound),
1209 "no-value" => Ok(Self::NoValue),
1210 "non-class-used-as-attribute" => Ok(Self::NonClassUsedAsAttribute),
1211 "non-documented-constant" => Ok(Self::NonDocumentedConstant),
1212 "non-documented-method" => Ok(Self::NonDocumentedMethod),
1213 "non-documented-property" => Ok(Self::NonDocumentedProperty),
1214 "non-existent-attribute-class" => Ok(Self::NonExistentAttributeClass),
1215 "non-existent-catch-type" => Ok(Self::NonExistentCatchType),
1216 "non-existent-class" => Ok(Self::NonExistentClass),
1217 "non-existent-class-constant" => Ok(Self::NonExistentClassConstant),
1218 "non-existent-class-like" => Ok(Self::NonExistentClassLike),
1219 "non-existent-constant" => Ok(Self::NonExistentConstant),
1220 "non-existent-function" => Ok(Self::NonExistentFunction),
1221 "non-existent-method" => Ok(Self::NonExistentMethod),
1222 "non-existent-property" => Ok(Self::NonExistentProperty),
1223 "non-existent-use-import" => Ok(Self::NonExistentUseImport),
1224 "non-iterable-object-iteration" => Ok(Self::NonIterableObjectIteration),
1225 "non-static-abstract-implementation" => Ok(Self::NonStaticAbstractImplementation),
1226 "null-argument" => Ok(Self::NullArgument),
1227 "null-array-access" => Ok(Self::NullArrayAccess),
1228 "null-array-index" => Ok(Self::NullArrayIndex),
1229 "null-destructuring-source" => Ok(Self::NullDestructuringSource),
1230 "null-iterator" => Ok(Self::NullIterator),
1231 "null-operand" => Ok(Self::NullOperand),
1232 "null-property-access" => Ok(Self::NullPropertyAccess),
1233 "nullable-return-statement" => Ok(Self::NullableReturnStatement),
1234 "overly-wide-return-type" => Ok(Self::OverlyWideReturnType),
1235 "override-final-constant" => Ok(Self::OverrideFinalConstant),
1236 "override-final-method" => Ok(Self::OverrideFinalMethod),
1237 "override-final-property" => Ok(Self::OverrideFinalProperty),
1238 "override-final-property-hook" => Ok(Self::OverrideFinalPropertyHook),
1239 "paradoxical-condition" => Ok(Self::ParadoxicalCondition),
1240 "parent-outside-class-scope" => Ok(Self::ParentOutsideClassScope),
1241 "possible-method-access-on-null" => Ok(Self::PossibleMethodAccessOnNull),
1242 "possibly-array-append-overflow" => Ok(Self::PossiblyArrayAppendOverflow),
1243 "possibly-false-argument" => Ok(Self::PossiblyFalseArgument),
1244 "possibly-false-array-access" => Ok(Self::PossiblyFalseArrayAccess),
1245 "possibly-false-iterator" => Ok(Self::PossiblyFalseIterator),
1246 "possibly-false-operand" => Ok(Self::PossiblyFalseOperand),
1247 "possibly-invalid-argument" => Ok(Self::PossiblyInvalidArgument),
1248 "possibly-invalid-array-access" => Ok(Self::PossiblyInvalidArrayAccess),
1249 "possibly-invalid-clone" => Ok(Self::PossiblyInvalidClone),
1250 "possibly-invalid-iterator" => Ok(Self::PossiblyInvalidIterator),
1251 "possibly-invalid-operand" => Ok(Self::PossiblyInvalidOperand),
1252 "possibly-invalid-property-write" => Ok(Self::PossiblyInvalidPropertyWrite),
1253 "possibly-non-existent-method" => Ok(Self::PossiblyNonExistentMethod),
1254 "possibly-non-existent-property" => Ok(Self::PossiblyNonExistentProperty),
1255 "possibly-null-argument" => Ok(Self::PossiblyNullArgument),
1256 "possibly-null-array-access" => Ok(Self::PossiblyNullArrayAccess),
1257 "possibly-null-array-index" => Ok(Self::PossiblyNullArrayIndex),
1258 "possibly-null-destructuring-source" => Ok(Self::PossiblyNullDestructuringSource),
1259 "possibly-null-iterator" => Ok(Self::PossiblyNullIterator),
1260 "possibly-null-operand" => Ok(Self::PossiblyNullOperand),
1261 "possibly-null-property-access" => Ok(Self::PossiblyNullPropertyAccess),
1262 "possibly-static-access-on-interface" => Ok(Self::PossiblyStaticAccessOnInterface),
1263 "possibly-undefined-array-index" => Ok(Self::PossiblyUndefinedArrayIndex),
1264 "possibly-undefined-int-array-index" => Ok(Self::PossiblyUndefinedIntArrayIndex),
1265 "possibly-undefined-string-array-index" => Ok(Self::PossiblyUndefinedStringArrayIndex),
1266 "possibly-undefined-variable" => Ok(Self::PossiblyUndefinedVariable),
1267 "property-type-coercion" => Ok(Self::PropertyTypeCoercion),
1268 "psalm-trace" => Ok(Self::PsalmTrace),
1269 "redundant-cast" => Ok(Self::RedundantCast),
1270 "redundant-comparison" => Ok(Self::RedundantComparison),
1271 "redundant-condition" => Ok(Self::RedundantCondition),
1272 "redundant-docblock-type" => Ok(Self::RedundantDocblockType),
1273 "redundant-isset-check" => Ok(Self::RedundantIssetCheck),
1274 "redundant-key-check" => Ok(Self::RedundantKeyCheck),
1275 "redundant-logical-operation" => Ok(Self::RedundantLogicalOperation),
1276 "redundant-nonnull-entry-check" => Ok(Self::RedundantNonnullEntryCheck),
1277 "redundant-nonnull-type-comparison" => Ok(Self::RedundantNonnullTypeComparison),
1278 "redundant-null-coalesce" => Ok(Self::RedundantNullCoalesce),
1279 "redundant-nullsafe-operator" => Ok(Self::RedundantNullsafeOperator),
1280 "redundant-type-comparison" => Ok(Self::RedundantTypeComparison),
1281 "reference-constraint-violation" => Ok(Self::ReferenceConstraintViolation),
1282 "reference-reused-from-confusing-scope" => Ok(Self::ReferenceReusedFromConfusingScope),
1283 "reference-to-undefined-variable" => Ok(Self::ReferenceToUndefinedVariable),
1284 "self-outside-class-scope" => Ok(Self::SelfOutsideClassScope),
1285 "side-effects-in-condition" => Ok(Self::SideEffectsInCondition),
1286 "skip-in-keyed-destructuring" => Ok(Self::SkipInKeyedDestructuring),
1287 "spread-in-destructuring" => Ok(Self::SpreadInDestructuring),
1288 "static-access-on-interface" => Ok(Self::StaticAccessOnInterface),
1289 "static-outside-class-scope" => Ok(Self::StaticOutsideClassScope),
1290 "string-constant-selector" => Ok(Self::StringConstantSelector),
1291 "string-member-selector" => Ok(Self::StringMemberSelector),
1292 "template-constraint-violation" => Ok(Self::TemplateConstraintViolation),
1293 "too-few-arguments" => Ok(Self::TooFewArguments),
1294 "too-many-arguments" => Ok(Self::TooManyArguments),
1295 "trait-constant-override" => Ok(Self::TraitConstantOverride),
1296 "trait-instantiation" => Ok(Self::TraitInstantiation),
1297 "type-confirmation" => Ok(Self::TypeConfirmation),
1298 "type-inspection" => Ok(Self::TypeInspection),
1299 "unavailable-class-constant" => Ok(Self::UnavailableClassConstant),
1300 "unavailable-class-like" => Ok(Self::UnavailableClassLike),
1301 "unavailable-constant" => Ok(Self::UnavailableConstant),
1302 "unavailable-enum-case" => Ok(Self::UnavailableEnumCase),
1303 "unavailable-function" => Ok(Self::UnavailableFunction),
1304 "unavailable-method" => Ok(Self::UnavailableMethod),
1305 "unavailable-property" => Ok(Self::UnavailableProperty),
1306 "undefined-int-array-index" => Ok(Self::UndefinedIntArrayIndex),
1307 "undefined-string-array-index" => Ok(Self::UndefinedStringArrayIndex),
1308 "undefined-variable" => Ok(Self::UndefinedVariable),
1309 "undefined-variable-in-closure-use" => Ok(Self::UndefinedVariableInClosureUse),
1310 "unevaluated-code" => Ok(Self::UnevaluatedCode),
1311 "unhandled-thrown-type" => Ok(Self::UnhandledThrownType),
1312 "unimplemented-abstract-method" => Ok(Self::UnimplementedAbstractMethod),
1313 "unimplemented-abstract-property-hook" => Ok(Self::UnimplementedAbstractPropertyHook),
1314 "uninitialized-property" => Ok(Self::UninitializedProperty),
1315 "unknown-class-instantiation" => Ok(Self::UnknownClassInstantiation),
1316 "unknown-constant-selector-type" => Ok(Self::UnknownConstantSelectorType),
1317 "unknown-iterator-type" => Ok(Self::UnknownIteratorType),
1318 "unknown-match-subject-type" => Ok(Self::UnknownMatchSubjectType),
1319 "unknown-member-selector-type" => Ok(Self::UnknownMemberSelectorType),
1320 "unknown-yield-from-iterator-type" => Ok(Self::UnknownYieldFromIteratorType),
1321 "unreachable-else-clause" => Ok(Self::UnreachableElseClause),
1322 "unreachable-match-arm" => Ok(Self::UnreachableMatchArm),
1323 "unreachable-match-default-arm" => Ok(Self::UnreachableMatchDefaultArm),
1324 "unreachable-switch-case" => Ok(Self::UnreachableSwitchCase),
1325 "unreachable-switch-default" => Ok(Self::UnreachableSwitchDefault),
1326 "unresolvable-class-constant" => Ok(Self::UnresolvableClassConstant),
1327 "unsafe-instantiation" => Ok(Self::UnsafeInstantiation),
1328 "unused-function-call" => Ok(Self::UnusedFunctionCall),
1329 "unused-method" => Ok(Self::UnusedMethod),
1330 "unused-method-call" => Ok(Self::UnusedMethodCall),
1331 "unused-parameter" => Ok(Self::UnusedParameter),
1332 "unused-property" => Ok(Self::UnusedProperty),
1333 "unused-statement" => Ok(Self::UnusedStatement),
1334 "unused-template-parameter" => Ok(Self::UnusedTemplateParameter),
1335 "useless-control-flow" => Ok(Self::UselessControlFlow),
1336 "where-constraint-violation" => Ok(Self::WhereConstraintViolation),
1337 "write-only-property" => Ok(Self::WriteOnlyProperty),
1338 "yield-from-invalid-key-type" => Ok(Self::YieldFromInvalidKeyType),
1339 "yield-from-invalid-send-type" => Ok(Self::YieldFromInvalidSendType),
1340 "yield-from-invalid-value-type" => Ok(Self::YieldFromInvalidValueType),
1341 "yield-from-non-iterable" => Ok(Self::YieldFromNonIterable),
1342 "yield-outside-function" => Ok(Self::YieldOutsideFunction),
1343 _ => Err("unknown issue code"),
1344 }
1345 }
1346}
1347
1348impl std::fmt::Display for IssueCode {
1349 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1350 write!(f, "{}", self.as_str())
1351 }
1352}
1353
1354impl std::convert::TryFrom<&str> for IssueCode {
1355 type Error = &'static str;
1356
1357 fn try_from(value: &str) -> Result<Self, Self::Error> {
1358 <Self as std::str::FromStr>::from_str(value)
1359 }
1360}
1361
1362impl std::convert::From<IssueCode> for &'static str {
1363 fn from(val: IssueCode) -> Self {
1364 val.as_str()
1365 }
1366}
1367
1368impl std::convert::From<IssueCode> for String {
1369 fn from(val: IssueCode) -> Self {
1370 val.as_str().to_string()
1371 }
1372}
1373
1374impl std::borrow::Borrow<str> for IssueCode {
1375 fn borrow(&self) -> &'static str {
1376 self.as_str()
1377 }
1378}
1379
1380impl<'code> std::borrow::Borrow<str> for &'code IssueCode {
1381 fn borrow(&self) -> &'code str {
1382 self.as_str()
1383 }
1384}