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