mago-analyzer 1.45.0

A PHP static analyzer that can detect type errors in PHP code, and provide suggestions for fixing them.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
//! This file is auto-generated. Do not edit manually.

/// An issue code representing a specific type of analysis issue.
///
/// Each issue code corresponds to a unique identifier for a particular
/// kind of issue that the analyzer can detect during code analysis.
///
/// This enum is non-exhaustive; new issue codes may be added in future versions.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u16)]
#[non_exhaustive]
pub enum IssueCode {
    AbstractClassUsedAsAttribute,
    AbstractInstantiation,
    AlwaysMatchingSwitchCase,
    AmbiguousClassLikeConstantAccess,
    AmbiguousInstantiationTarget,
    AmbiguousObjectMethodAccess,
    AmbiguousObjectPropertyAccess,
    ArrayAppendInReadContext,
    ArrayAppendOverflow,
    ArrayToStringConversion,
    AssignmentToConstant,
    AssignmentToThis,
    AttributeNotRepeatable,
    AvoidCatchingError,
    BackedPropertyReferenceHook,
    CatchTypeNotThrowable,
    ClassMustBeFinal,
    ClassNotMarkedAsAttribute,
    CloneInsideLoop,
    ConditionIsTooComplex,
    ConflictingReferenceConstraint,
    ConflictingTemplateEqualityBounds,
    DeprecatedClass,
    DeprecatedClosure,
    DeprecatedConstant,
    DeprecatedFeature,
    DeprecatedFunction,
    DeprecatedMethod,
    DeprecatedTrait,
    DirectTraitConstantAccess,
    DocblockParameterNarrowing,
    DocblockTypeMismatch,
    DuplicateArrayKey,
    DuplicateCaughtType,
    DuplicateClosureUseVariable,
    DuplicateDefinition,
    DuplicateEnumCaseValue,
    DuplicateNamedArgument,
    DynamicStaticMethodCall,
    EmptyMatchExpression,
    EnumInstantiation,
    EnumIteration,
    ExcessTemplateParameter,
    ExperimentalUsage,
    ExpressionIsTooComplex,
    ExtendFinalClass,
    FalsableReturnStatement,
    FalseArgument,
    FalseArrayAccess,
    FalseIterator,
    FalseOperand,
    GenericObjectIteration,
    HiddenGeneratorReturn,
    ImplicitResourceToStringCast,
    ImplicitToStringCast,
    ImpossibleArrayAccess,
    ImpossibleArrayAssignment,
    ImpossibleAssignment,
    ImpossibleCondition,
    ImpossibleKeyCheck,
    ImpossibleNonnullEntryCheck,
    ImpossibleNullTypeComparison,
    ImpossibleTypeComparison,
    ImpreciseType,
    ImpureConstruct,
    ImpureStaticVariable,
    IncompatibleConstantAccess,
    IncompatibleConstantOverride,
    IncompatibleConstantType,
    IncompatibleConstantVisibility,
    IncompatibleParameterCount,
    IncompatibleParameterName,
    IncompatibleParameterType,
    IncompatiblePropertyAccess,
    IncompatiblePropertyDefault,
    IncompatiblePropertyHookParameterType,
    IncompatiblePropertyHookSignature,
    IncompatiblePropertyOverride,
    IncompatiblePropertyReadonly,
    IncompatiblePropertyStatic,
    IncompatiblePropertyType,
    IncompatiblePropertyVisibility,
    IncompatibleReadonlyModifier,
    IncompatibleReturnType,
    IncompatibleStaticModifier,
    IncompatibleTemplateLowerBound,
    IncompatibleVisibility,
    InconsistentTemplate,
    IncorrectClassLikeCasing,
    IncorrectFunctionCasing,
    InterfaceInstantiation,
    InvalidArgument,
    InvalidArrayAccess,
    InvalidArrayAccessAssignmentValue,
    InvalidArrayElement,
    InvalidArrayElementKey,
    InvalidArrayIndex,
    InvalidAssignment,
    InvalidAttributeTarget,
    InvalidBreak,
    InvalidCallable,
    InvalidCatchType,
    InvalidCatchTypeNotClassOrInterface,
    InvalidClassConstantOnString,
    InvalidClassStringExpression,
    InvalidClone,
    InvalidConstantSelector,
    InvalidConstantValue,
    InvalidContinue,
    InvalidDestructuringSource,
    InvalidDocblock,
    InvalidEnumCaseValue,
    InvalidExtend,
    InvalidForeachKey,
    InvalidForeachValue,
    InvalidGeneratorReturnType,
    InvalidGlobal,
    InvalidImplement,
    InvalidIssetExpression,
    InvalidIterator,
    InvalidMemberSelector,
    InvalidMethodAccess,
    InvalidNamedArgument,
    InvalidOperand,
    InvalidOverrideAttribute,
    InvalidParameterDefaultValue,
    InvalidParentType,
    InvalidPassByReference,
    InvalidPropertyAccess,
    InvalidPropertyAssignmentValue,
    InvalidPropertyDefaultValue,
    InvalidPropertyRead,
    InvalidPropertyWrite,
    InvalidReturnStatement,
    InvalidScopeKeywordContext,
    InvalidStaticMethodAccess,
    InvalidStaticMethodCall,
    InvalidStaticPropertyAccess,
    InvalidTemplateParameter,
    InvalidThrow,
    InvalidTraitAliasModifier,
    InvalidTraitUse,
    InvalidTypeCast,
    InvalidUnset,
    InvalidYieldKeyType,
    InvalidYieldValueType,
    LessSpecificArgument,
    LessSpecificNestedArgumentType,
    LessSpecificNestedReturnStatement,
    LessSpecificReturnStatement,
    ListDestructureNegativeKey,
    ListDestructureStringKey,
    ListUsedInReadContext,
    MatchArmAlwaysTrue,
    MatchDefaultArmAlwaysExecuted,
    MatchExpressionOnlyDefaultArm,
    MatchNotExhaustive,
    MatchSubjectTypeIsNever,
    MethodAccessOnNull,
    MismatchedArrayIndex,
    MissingApiOrInternal,
    MissingConstantType,
    MissingConstructor,
    MissingMagicMethod,
    MissingOverrideAttribute,
    MissingParameterType,
    MissingPropertyType,
    MissingRequiredInterface,
    MissingRequiredParent,
    MissingReturnStatement,
    MissingReturnType,
    MissingTemplateParameter,
    MixedArgument,
    MixedArrayAccess,
    MixedArrayAssignment,
    MixedArrayIndex,
    MixedAssignment,
    MixedClone,
    MixedDestructuringShape,
    MixedMethodAccess,
    MixedOperand,
    MixedPropertyAccess,
    MixedPropertyTypeCoercion,
    MixedReturnStatement,
    NameAlreadyInUse,
    NamedArgumentAfterPositional,
    NamedArgumentNotAllowed,
    NamedArgumentOverridesPositional,
    NeverMatchingSwitchCase,
    NeverReturn,
    NoValidCatchTypeFound,
    NoValue,
    NonClassUsedAsAttribute,
    NonDocumentedConstant,
    NonDocumentedMethod,
    NonDocumentedProperty,
    NonExistentAttributeClass,
    NonExistentCatchType,
    NonExistentClass,
    NonExistentClassConstant,
    NonExistentClassLike,
    NonExistentConstant,
    NonExistentFunction,
    NonExistentMethod,
    NonExistentProperty,
    NonExistentUseImport,
    NonIterableObjectIteration,
    NonStaticAbstractImplementation,
    NullArgument,
    NullArrayAccess,
    NullArrayIndex,
    NullDestructuringSource,
    NullIterator,
    NullOperand,
    NullPropertyAccess,
    NullableReturnStatement,
    OverlyWideReturnType,
    OverrideFinalConstant,
    OverrideFinalMethod,
    OverrideFinalProperty,
    OverrideFinalPropertyHook,
    ParadoxicalCondition,
    ParentOutsideClassScope,
    PossibleMethodAccessOnNull,
    PossiblyArrayAppendOverflow,
    PossiblyFalseArgument,
    PossiblyFalseArrayAccess,
    PossiblyFalseIterator,
    PossiblyFalseOperand,
    PossiblyInvalidArgument,
    PossiblyInvalidArrayAccess,
    PossiblyInvalidClone,
    PossiblyInvalidIterator,
    PossiblyInvalidOperand,
    PossiblyInvalidPropertyWrite,
    PossiblyNonExistentMethod,
    PossiblyNonExistentProperty,
    PossiblyNullArgument,
    PossiblyNullArrayAccess,
    PossiblyNullArrayIndex,
    PossiblyNullDestructuringSource,
    PossiblyNullIterator,
    PossiblyNullOperand,
    PossiblyNullPropertyAccess,
    PossiblyStaticAccessOnInterface,
    PossiblyUndefinedArrayIndex,
    PossiblyUndefinedIntArrayIndex,
    PossiblyUndefinedStringArrayIndex,
    PossiblyUndefinedVariable,
    PropertyTypeCoercion,
    PsalmTrace,
    RedundantCast,
    RedundantComparison,
    RedundantCondition,
    RedundantDocblockType,
    RedundantIssetCheck,
    RedundantKeyCheck,
    RedundantLogicalOperation,
    RedundantNonnullEntryCheck,
    RedundantNonnullTypeComparison,
    RedundantNullCoalesce,
    RedundantNullsafeOperator,
    RedundantTypeComparison,
    ReferenceConstraintViolation,
    ReferenceReusedFromConfusingScope,
    ReferenceToUndefinedVariable,
    SelfOutsideClassScope,
    SideEffectsInCondition,
    SkipInKeyedDestructuring,
    SpreadInDestructuring,
    StaticAccessOnInterface,
    StaticOutsideClassScope,
    StringConstantSelector,
    StringMemberSelector,
    TemplateConstraintViolation,
    TooFewArguments,
    TooManyArguments,
    TraitConstantOverride,
    TraitInstantiation,
    TypeConfirmation,
    TypeInspection,
    UnavailableClassConstant,
    UnavailableClassLike,
    UnavailableConstant,
    UnavailableEnumCase,
    UnavailableFunction,
    UnavailableMethod,
    UnavailableProperty,
    UndefinedIntArrayIndex,
    UndefinedStringArrayIndex,
    UndefinedVariable,
    UndefinedVariableInClosureUse,
    UnevaluatedCode,
    UnhandledThrownType,
    UnimplementedAbstractMethod,
    UnimplementedAbstractPropertyHook,
    UninitializedProperty,
    UnknownClassInstantiation,
    UnknownConstantSelectorType,
    UnknownIteratorType,
    UnknownMatchSubjectType,
    UnknownMemberSelectorType,
    UnknownYieldFromIteratorType,
    UnreachableElseClause,
    UnreachableMatchArm,
    UnreachableMatchDefaultArm,
    UnreachableSwitchCase,
    UnreachableSwitchDefault,
    UnresolvableClassConstant,
    UnsafeInstantiation,
    UnusedFunctionCall,
    UnusedMethod,
    UnusedMethodCall,
    UnusedParameter,
    UnusedProperty,
    UnusedStatement,
    UnusedTemplateParameter,
    UselessControlFlow,
    WhereConstraintViolation,
    WriteOnlyProperty,
    YieldFromInvalidKeyType,
    YieldFromInvalidSendType,
    YieldFromInvalidValueType,
    YieldFromNonIterable,
    YieldOutsideFunction,
}

impl IssueCode {
    #[must_use]
    pub fn as_str(&self) -> &'static str {
        match self {
            Self::AbstractClassUsedAsAttribute => "abstract-class-used-as-attribute",
            Self::AbstractInstantiation => "abstract-instantiation",
            Self::AlwaysMatchingSwitchCase => "always-matching-switch-case",
            Self::AmbiguousClassLikeConstantAccess => "ambiguous-class-like-constant-access",
            Self::AmbiguousInstantiationTarget => "ambiguous-instantiation-target",
            Self::AmbiguousObjectMethodAccess => "ambiguous-object-method-access",
            Self::AmbiguousObjectPropertyAccess => "ambiguous-object-property-access",
            Self::ArrayAppendInReadContext => "array-append-in-read-context",
            Self::ArrayAppendOverflow => "array-append-overflow",
            Self::ArrayToStringConversion => "array-to-string-conversion",
            Self::AssignmentToConstant => "assignment-to-constant",
            Self::AssignmentToThis => "assignment-to-this",
            Self::AttributeNotRepeatable => "attribute-not-repeatable",
            Self::AvoidCatchingError => "avoid-catching-error",
            Self::BackedPropertyReferenceHook => "backed-property-reference-hook",
            Self::CatchTypeNotThrowable => "catch-type-not-throwable",
            Self::ClassMustBeFinal => "class-must-be-final",
            Self::ClassNotMarkedAsAttribute => "class-not-marked-as-attribute",
            Self::CloneInsideLoop => "clone-inside-loop",
            Self::ConditionIsTooComplex => "condition-is-too-complex",
            Self::ConflictingReferenceConstraint => "conflicting-reference-constraint",
            Self::ConflictingTemplateEqualityBounds => "conflicting-template-equality-bounds",
            Self::DeprecatedClass => "deprecated-class",
            Self::DeprecatedClosure => "deprecated-closure",
            Self::DeprecatedConstant => "deprecated-constant",
            Self::DeprecatedFeature => "deprecated-feature",
            Self::DeprecatedFunction => "deprecated-function",
            Self::DeprecatedMethod => "deprecated-method",
            Self::DeprecatedTrait => "deprecated-trait",
            Self::DirectTraitConstantAccess => "direct-trait-constant-access",
            Self::DocblockParameterNarrowing => "docblock-parameter-narrowing",
            Self::DocblockTypeMismatch => "docblock-type-mismatch",
            Self::DuplicateArrayKey => "duplicate-array-key",
            Self::DuplicateCaughtType => "duplicate-caught-type",
            Self::DuplicateClosureUseVariable => "duplicate-closure-use-variable",
            Self::DuplicateDefinition => "duplicate-definition",
            Self::DuplicateEnumCaseValue => "duplicate-enum-case-value",
            Self::DuplicateNamedArgument => "duplicate-named-argument",
            Self::DynamicStaticMethodCall => "dynamic-static-method-call",
            Self::EmptyMatchExpression => "empty-match-expression",
            Self::EnumInstantiation => "enum-instantiation",
            Self::EnumIteration => "enum-iteration",
            Self::ExcessTemplateParameter => "excess-template-parameter",
            Self::ExperimentalUsage => "experimental-usage",
            Self::ExpressionIsTooComplex => "expression-is-too-complex",
            Self::ExtendFinalClass => "extend-final-class",
            Self::FalsableReturnStatement => "falsable-return-statement",
            Self::FalseArgument => "false-argument",
            Self::FalseArrayAccess => "false-array-access",
            Self::FalseIterator => "false-iterator",
            Self::FalseOperand => "false-operand",
            Self::GenericObjectIteration => "generic-object-iteration",
            Self::HiddenGeneratorReturn => "hidden-generator-return",
            Self::ImplicitResourceToStringCast => "implicit-resource-to-string-cast",
            Self::ImplicitToStringCast => "implicit-to-string-cast",
            Self::ImpossibleArrayAccess => "impossible-array-access",
            Self::ImpossibleArrayAssignment => "impossible-array-assignment",
            Self::ImpossibleAssignment => "impossible-assignment",
            Self::ImpossibleCondition => "impossible-condition",
            Self::ImpossibleKeyCheck => "impossible-key-check",
            Self::ImpossibleNonnullEntryCheck => "impossible-nonnull-entry-check",
            Self::ImpossibleNullTypeComparison => "impossible-null-type-comparison",
            Self::ImpossibleTypeComparison => "impossible-type-comparison",
            Self::ImpreciseType => "imprecise-type",
            Self::ImpureConstruct => "impure-construct",
            Self::ImpureStaticVariable => "impure-static-variable",
            Self::IncompatibleConstantAccess => "incompatible-constant-access",
            Self::IncompatibleConstantOverride => "incompatible-constant-override",
            Self::IncompatibleConstantType => "incompatible-constant-type",
            Self::IncompatibleConstantVisibility => "incompatible-constant-visibility",
            Self::IncompatibleParameterCount => "incompatible-parameter-count",
            Self::IncompatibleParameterName => "incompatible-parameter-name",
            Self::IncompatibleParameterType => "incompatible-parameter-type",
            Self::IncompatiblePropertyAccess => "incompatible-property-access",
            Self::IncompatiblePropertyDefault => "incompatible-property-default",
            Self::IncompatiblePropertyHookParameterType => "incompatible-property-hook-parameter-type",
            Self::IncompatiblePropertyHookSignature => "incompatible-property-hook-signature",
            Self::IncompatiblePropertyOverride => "incompatible-property-override",
            Self::IncompatiblePropertyReadonly => "incompatible-property-readonly",
            Self::IncompatiblePropertyStatic => "incompatible-property-static",
            Self::IncompatiblePropertyType => "incompatible-property-type",
            Self::IncompatiblePropertyVisibility => "incompatible-property-visibility",
            Self::IncompatibleReadonlyModifier => "incompatible-readonly-modifier",
            Self::IncompatibleReturnType => "incompatible-return-type",
            Self::IncompatibleStaticModifier => "incompatible-static-modifier",
            Self::IncompatibleTemplateLowerBound => "incompatible-template-lower-bound",
            Self::IncompatibleVisibility => "incompatible-visibility",
            Self::InconsistentTemplate => "inconsistent-template",
            Self::IncorrectClassLikeCasing => "incorrect-class-like-casing",
            Self::IncorrectFunctionCasing => "incorrect-function-casing",
            Self::InterfaceInstantiation => "interface-instantiation",
            Self::InvalidArgument => "invalid-argument",
            Self::InvalidArrayAccess => "invalid-array-access",
            Self::InvalidArrayAccessAssignmentValue => "invalid-array-access-assignment-value",
            Self::InvalidArrayElement => "invalid-array-element",
            Self::InvalidArrayElementKey => "invalid-array-element-key",
            Self::InvalidArrayIndex => "invalid-array-index",
            Self::InvalidAssignment => "invalid-assignment",
            Self::InvalidAttributeTarget => "invalid-attribute-target",
            Self::InvalidBreak => "invalid-break",
            Self::InvalidCallable => "invalid-callable",
            Self::InvalidCatchType => "invalid-catch-type",
            Self::InvalidCatchTypeNotClassOrInterface => "invalid-catch-type-not-class-or-interface",
            Self::InvalidClassConstantOnString => "invalid-class-constant-on-string",
            Self::InvalidClassStringExpression => "invalid-class-string-expression",
            Self::InvalidClone => "invalid-clone",
            Self::InvalidConstantSelector => "invalid-constant-selector",
            Self::InvalidConstantValue => "invalid-constant-value",
            Self::InvalidContinue => "invalid-continue",
            Self::InvalidDestructuringSource => "invalid-destructuring-source",
            Self::InvalidDocblock => "invalid-docblock",
            Self::InvalidEnumCaseValue => "invalid-enum-case-value",
            Self::InvalidExtend => "invalid-extend",
            Self::InvalidForeachKey => "invalid-foreach-key",
            Self::InvalidForeachValue => "invalid-foreach-value",
            Self::InvalidGeneratorReturnType => "invalid-generator-return-type",
            Self::InvalidGlobal => "invalid-global",
            Self::InvalidImplement => "invalid-implement",
            Self::InvalidIssetExpression => "invalid-isset-expression",
            Self::InvalidIterator => "invalid-iterator",
            Self::InvalidMemberSelector => "invalid-member-selector",
            Self::InvalidMethodAccess => "invalid-method-access",
            Self::InvalidNamedArgument => "invalid-named-argument",
            Self::InvalidOperand => "invalid-operand",
            Self::InvalidOverrideAttribute => "invalid-override-attribute",
            Self::InvalidParameterDefaultValue => "invalid-parameter-default-value",
            Self::InvalidParentType => "invalid-parent-type",
            Self::InvalidPassByReference => "invalid-pass-by-reference",
            Self::InvalidPropertyAccess => "invalid-property-access",
            Self::InvalidPropertyAssignmentValue => "invalid-property-assignment-value",
            Self::InvalidPropertyDefaultValue => "invalid-property-default-value",
            Self::InvalidPropertyRead => "invalid-property-read",
            Self::InvalidPropertyWrite => "invalid-property-write",
            Self::InvalidReturnStatement => "invalid-return-statement",
            Self::InvalidScopeKeywordContext => "invalid-scope-keyword-context",
            Self::InvalidStaticMethodAccess => "invalid-static-method-access",
            Self::InvalidStaticMethodCall => "invalid-static-method-call",
            Self::InvalidStaticPropertyAccess => "invalid-static-property-access",
            Self::InvalidTemplateParameter => "invalid-template-parameter",
            Self::InvalidThrow => "invalid-throw",
            Self::InvalidTraitAliasModifier => "invalid-trait-alias-modifier",
            Self::InvalidTraitUse => "invalid-trait-use",
            Self::InvalidTypeCast => "invalid-type-cast",
            Self::InvalidUnset => "invalid-unset",
            Self::InvalidYieldKeyType => "invalid-yield-key-type",
            Self::InvalidYieldValueType => "invalid-yield-value-type",
            Self::LessSpecificArgument => "less-specific-argument",
            Self::LessSpecificNestedArgumentType => "less-specific-nested-argument-type",
            Self::LessSpecificNestedReturnStatement => "less-specific-nested-return-statement",
            Self::LessSpecificReturnStatement => "less-specific-return-statement",
            Self::ListDestructureNegativeKey => "list-destructure-negative-key",
            Self::ListDestructureStringKey => "list-destructure-string-key",
            Self::ListUsedInReadContext => "list-used-in-read-context",
            Self::MatchArmAlwaysTrue => "match-arm-always-true",
            Self::MatchDefaultArmAlwaysExecuted => "match-default-arm-always-executed",
            Self::MatchExpressionOnlyDefaultArm => "match-expression-only-default-arm",
            Self::MatchNotExhaustive => "match-not-exhaustive",
            Self::MatchSubjectTypeIsNever => "match-subject-type-is-never",
            Self::MethodAccessOnNull => "method-access-on-null",
            Self::MismatchedArrayIndex => "mismatched-array-index",
            Self::MissingApiOrInternal => "missing-api-or-internal",
            Self::MissingConstantType => "missing-constant-type",
            Self::MissingConstructor => "missing-constructor",
            Self::MissingMagicMethod => "missing-magic-method",
            Self::MissingOverrideAttribute => "missing-override-attribute",
            Self::MissingParameterType => "missing-parameter-type",
            Self::MissingPropertyType => "missing-property-type",
            Self::MissingRequiredInterface => "missing-required-interface",
            Self::MissingRequiredParent => "missing-required-parent",
            Self::MissingReturnStatement => "missing-return-statement",
            Self::MissingReturnType => "missing-return-type",
            Self::MissingTemplateParameter => "missing-template-parameter",
            Self::MixedArgument => "mixed-argument",
            Self::MixedArrayAccess => "mixed-array-access",
            Self::MixedArrayAssignment => "mixed-array-assignment",
            Self::MixedArrayIndex => "mixed-array-index",
            Self::MixedAssignment => "mixed-assignment",
            Self::MixedClone => "mixed-clone",
            Self::MixedDestructuringShape => "mixed-destructuring-shape",
            Self::MixedMethodAccess => "mixed-method-access",
            Self::MixedOperand => "mixed-operand",
            Self::MixedPropertyAccess => "mixed-property-access",
            Self::MixedPropertyTypeCoercion => "mixed-property-type-coercion",
            Self::MixedReturnStatement => "mixed-return-statement",
            Self::NameAlreadyInUse => "name-already-in-use",
            Self::NamedArgumentAfterPositional => "named-argument-after-positional",
            Self::NamedArgumentNotAllowed => "named-argument-not-allowed",
            Self::NamedArgumentOverridesPositional => "named-argument-overrides-positional",
            Self::NeverMatchingSwitchCase => "never-matching-switch-case",
            Self::NeverReturn => "never-return",
            Self::NoValidCatchTypeFound => "no-valid-catch-type-found",
            Self::NoValue => "no-value",
            Self::NonClassUsedAsAttribute => "non-class-used-as-attribute",
            Self::NonDocumentedConstant => "non-documented-constant",
            Self::NonDocumentedMethod => "non-documented-method",
            Self::NonDocumentedProperty => "non-documented-property",
            Self::NonExistentAttributeClass => "non-existent-attribute-class",
            Self::NonExistentCatchType => "non-existent-catch-type",
            Self::NonExistentClass => "non-existent-class",
            Self::NonExistentClassConstant => "non-existent-class-constant",
            Self::NonExistentClassLike => "non-existent-class-like",
            Self::NonExistentConstant => "non-existent-constant",
            Self::NonExistentFunction => "non-existent-function",
            Self::NonExistentMethod => "non-existent-method",
            Self::NonExistentProperty => "non-existent-property",
            Self::NonExistentUseImport => "non-existent-use-import",
            Self::NonIterableObjectIteration => "non-iterable-object-iteration",
            Self::NonStaticAbstractImplementation => "non-static-abstract-implementation",
            Self::NullArgument => "null-argument",
            Self::NullArrayAccess => "null-array-access",
            Self::NullArrayIndex => "null-array-index",
            Self::NullDestructuringSource => "null-destructuring-source",
            Self::NullIterator => "null-iterator",
            Self::NullOperand => "null-operand",
            Self::NullPropertyAccess => "null-property-access",
            Self::NullableReturnStatement => "nullable-return-statement",
            Self::OverlyWideReturnType => "overly-wide-return-type",
            Self::OverrideFinalConstant => "override-final-constant",
            Self::OverrideFinalMethod => "override-final-method",
            Self::OverrideFinalProperty => "override-final-property",
            Self::OverrideFinalPropertyHook => "override-final-property-hook",
            Self::ParadoxicalCondition => "paradoxical-condition",
            Self::ParentOutsideClassScope => "parent-outside-class-scope",
            Self::PossibleMethodAccessOnNull => "possible-method-access-on-null",
            Self::PossiblyArrayAppendOverflow => "possibly-array-append-overflow",
            Self::PossiblyFalseArgument => "possibly-false-argument",
            Self::PossiblyFalseArrayAccess => "possibly-false-array-access",
            Self::PossiblyFalseIterator => "possibly-false-iterator",
            Self::PossiblyFalseOperand => "possibly-false-operand",
            Self::PossiblyInvalidArgument => "possibly-invalid-argument",
            Self::PossiblyInvalidArrayAccess => "possibly-invalid-array-access",
            Self::PossiblyInvalidClone => "possibly-invalid-clone",
            Self::PossiblyInvalidIterator => "possibly-invalid-iterator",
            Self::PossiblyInvalidOperand => "possibly-invalid-operand",
            Self::PossiblyInvalidPropertyWrite => "possibly-invalid-property-write",
            Self::PossiblyNonExistentMethod => "possibly-non-existent-method",
            Self::PossiblyNonExistentProperty => "possibly-non-existent-property",
            Self::PossiblyNullArgument => "possibly-null-argument",
            Self::PossiblyNullArrayAccess => "possibly-null-array-access",
            Self::PossiblyNullArrayIndex => "possibly-null-array-index",
            Self::PossiblyNullDestructuringSource => "possibly-null-destructuring-source",
            Self::PossiblyNullIterator => "possibly-null-iterator",
            Self::PossiblyNullOperand => "possibly-null-operand",
            Self::PossiblyNullPropertyAccess => "possibly-null-property-access",
            Self::PossiblyStaticAccessOnInterface => "possibly-static-access-on-interface",
            Self::PossiblyUndefinedArrayIndex => "possibly-undefined-array-index",
            Self::PossiblyUndefinedIntArrayIndex => "possibly-undefined-int-array-index",
            Self::PossiblyUndefinedStringArrayIndex => "possibly-undefined-string-array-index",
            Self::PossiblyUndefinedVariable => "possibly-undefined-variable",
            Self::PropertyTypeCoercion => "property-type-coercion",
            Self::PsalmTrace => "psalm-trace",
            Self::RedundantCast => "redundant-cast",
            Self::RedundantComparison => "redundant-comparison",
            Self::RedundantCondition => "redundant-condition",
            Self::RedundantDocblockType => "redundant-docblock-type",
            Self::RedundantIssetCheck => "redundant-isset-check",
            Self::RedundantKeyCheck => "redundant-key-check",
            Self::RedundantLogicalOperation => "redundant-logical-operation",
            Self::RedundantNonnullEntryCheck => "redundant-nonnull-entry-check",
            Self::RedundantNonnullTypeComparison => "redundant-nonnull-type-comparison",
            Self::RedundantNullCoalesce => "redundant-null-coalesce",
            Self::RedundantNullsafeOperator => "redundant-nullsafe-operator",
            Self::RedundantTypeComparison => "redundant-type-comparison",
            Self::ReferenceConstraintViolation => "reference-constraint-violation",
            Self::ReferenceReusedFromConfusingScope => "reference-reused-from-confusing-scope",
            Self::ReferenceToUndefinedVariable => "reference-to-undefined-variable",
            Self::SelfOutsideClassScope => "self-outside-class-scope",
            Self::SideEffectsInCondition => "side-effects-in-condition",
            Self::SkipInKeyedDestructuring => "skip-in-keyed-destructuring",
            Self::SpreadInDestructuring => "spread-in-destructuring",
            Self::StaticAccessOnInterface => "static-access-on-interface",
            Self::StaticOutsideClassScope => "static-outside-class-scope",
            Self::StringConstantSelector => "string-constant-selector",
            Self::StringMemberSelector => "string-member-selector",
            Self::TemplateConstraintViolation => "template-constraint-violation",
            Self::TooFewArguments => "too-few-arguments",
            Self::TooManyArguments => "too-many-arguments",
            Self::TraitConstantOverride => "trait-constant-override",
            Self::TraitInstantiation => "trait-instantiation",
            Self::TypeConfirmation => "type-confirmation",
            Self::TypeInspection => "type-inspection",
            Self::UnavailableClassConstant => "unavailable-class-constant",
            Self::UnavailableClassLike => "unavailable-class-like",
            Self::UnavailableConstant => "unavailable-constant",
            Self::UnavailableEnumCase => "unavailable-enum-case",
            Self::UnavailableFunction => "unavailable-function",
            Self::UnavailableMethod => "unavailable-method",
            Self::UnavailableProperty => "unavailable-property",
            Self::UndefinedIntArrayIndex => "undefined-int-array-index",
            Self::UndefinedStringArrayIndex => "undefined-string-array-index",
            Self::UndefinedVariable => "undefined-variable",
            Self::UndefinedVariableInClosureUse => "undefined-variable-in-closure-use",
            Self::UnevaluatedCode => "unevaluated-code",
            Self::UnhandledThrownType => "unhandled-thrown-type",
            Self::UnimplementedAbstractMethod => "unimplemented-abstract-method",
            Self::UnimplementedAbstractPropertyHook => "unimplemented-abstract-property-hook",
            Self::UninitializedProperty => "uninitialized-property",
            Self::UnknownClassInstantiation => "unknown-class-instantiation",
            Self::UnknownConstantSelectorType => "unknown-constant-selector-type",
            Self::UnknownIteratorType => "unknown-iterator-type",
            Self::UnknownMatchSubjectType => "unknown-match-subject-type",
            Self::UnknownMemberSelectorType => "unknown-member-selector-type",
            Self::UnknownYieldFromIteratorType => "unknown-yield-from-iterator-type",
            Self::UnreachableElseClause => "unreachable-else-clause",
            Self::UnreachableMatchArm => "unreachable-match-arm",
            Self::UnreachableMatchDefaultArm => "unreachable-match-default-arm",
            Self::UnreachableSwitchCase => "unreachable-switch-case",
            Self::UnreachableSwitchDefault => "unreachable-switch-default",
            Self::UnresolvableClassConstant => "unresolvable-class-constant",
            Self::UnsafeInstantiation => "unsafe-instantiation",
            Self::UnusedFunctionCall => "unused-function-call",
            Self::UnusedMethod => "unused-method",
            Self::UnusedMethodCall => "unused-method-call",
            Self::UnusedParameter => "unused-parameter",
            Self::UnusedProperty => "unused-property",
            Self::UnusedStatement => "unused-statement",
            Self::UnusedTemplateParameter => "unused-template-parameter",
            Self::UselessControlFlow => "useless-control-flow",
            Self::WhereConstraintViolation => "where-constraint-violation",
            Self::WriteOnlyProperty => "write-only-property",
            Self::YieldFromInvalidKeyType => "yield-from-invalid-key-type",
            Self::YieldFromInvalidSendType => "yield-from-invalid-send-type",
            Self::YieldFromInvalidValueType => "yield-from-invalid-value-type",
            Self::YieldFromNonIterable => "yield-from-non-iterable",
            Self::YieldOutsideFunction => "yield-outside-function",
        }
    }

    #[must_use]
    pub fn as_u16(&self) -> u16 {
        *self as u16
    }

    #[must_use]
    pub fn all() -> &'static [IssueCode] {
        &[
            Self::AbstractClassUsedAsAttribute,
            Self::AbstractInstantiation,
            Self::AlwaysMatchingSwitchCase,
            Self::AmbiguousClassLikeConstantAccess,
            Self::AmbiguousInstantiationTarget,
            Self::AmbiguousObjectMethodAccess,
            Self::AmbiguousObjectPropertyAccess,
            Self::ArrayAppendInReadContext,
            Self::ArrayAppendOverflow,
            Self::ArrayToStringConversion,
            Self::AssignmentToConstant,
            Self::AssignmentToThis,
            Self::AttributeNotRepeatable,
            Self::AvoidCatchingError,
            Self::BackedPropertyReferenceHook,
            Self::CatchTypeNotThrowable,
            Self::ClassMustBeFinal,
            Self::ClassNotMarkedAsAttribute,
            Self::CloneInsideLoop,
            Self::ConditionIsTooComplex,
            Self::ConflictingReferenceConstraint,
            Self::ConflictingTemplateEqualityBounds,
            Self::DeprecatedClass,
            Self::DeprecatedClosure,
            Self::DeprecatedConstant,
            Self::DeprecatedFeature,
            Self::DeprecatedFunction,
            Self::DeprecatedMethod,
            Self::DeprecatedTrait,
            Self::DirectTraitConstantAccess,
            Self::DocblockParameterNarrowing,
            Self::DocblockTypeMismatch,
            Self::DuplicateArrayKey,
            Self::DuplicateCaughtType,
            Self::DuplicateClosureUseVariable,
            Self::DuplicateDefinition,
            Self::DuplicateEnumCaseValue,
            Self::DuplicateNamedArgument,
            Self::DynamicStaticMethodCall,
            Self::EmptyMatchExpression,
            Self::EnumInstantiation,
            Self::EnumIteration,
            Self::ExcessTemplateParameter,
            Self::ExperimentalUsage,
            Self::ExpressionIsTooComplex,
            Self::ExtendFinalClass,
            Self::FalsableReturnStatement,
            Self::FalseArgument,
            Self::FalseArrayAccess,
            Self::FalseIterator,
            Self::FalseOperand,
            Self::GenericObjectIteration,
            Self::HiddenGeneratorReturn,
            Self::ImplicitResourceToStringCast,
            Self::ImplicitToStringCast,
            Self::ImpossibleArrayAccess,
            Self::ImpossibleArrayAssignment,
            Self::ImpossibleAssignment,
            Self::ImpossibleCondition,
            Self::ImpossibleKeyCheck,
            Self::ImpossibleNonnullEntryCheck,
            Self::ImpossibleNullTypeComparison,
            Self::ImpossibleTypeComparison,
            Self::ImpreciseType,
            Self::ImpureConstruct,
            Self::ImpureStaticVariable,
            Self::IncompatibleConstantAccess,
            Self::IncompatibleConstantOverride,
            Self::IncompatibleConstantType,
            Self::IncompatibleConstantVisibility,
            Self::IncompatibleParameterCount,
            Self::IncompatibleParameterName,
            Self::IncompatibleParameterType,
            Self::IncompatiblePropertyAccess,
            Self::IncompatiblePropertyDefault,
            Self::IncompatiblePropertyHookParameterType,
            Self::IncompatiblePropertyHookSignature,
            Self::IncompatiblePropertyOverride,
            Self::IncompatiblePropertyReadonly,
            Self::IncompatiblePropertyStatic,
            Self::IncompatiblePropertyType,
            Self::IncompatiblePropertyVisibility,
            Self::IncompatibleReadonlyModifier,
            Self::IncompatibleReturnType,
            Self::IncompatibleStaticModifier,
            Self::IncompatibleTemplateLowerBound,
            Self::IncompatibleVisibility,
            Self::InconsistentTemplate,
            Self::IncorrectClassLikeCasing,
            Self::IncorrectFunctionCasing,
            Self::InterfaceInstantiation,
            Self::InvalidArgument,
            Self::InvalidArrayAccess,
            Self::InvalidArrayAccessAssignmentValue,
            Self::InvalidArrayElement,
            Self::InvalidArrayElementKey,
            Self::InvalidArrayIndex,
            Self::InvalidAssignment,
            Self::InvalidAttributeTarget,
            Self::InvalidBreak,
            Self::InvalidCallable,
            Self::InvalidCatchType,
            Self::InvalidCatchTypeNotClassOrInterface,
            Self::InvalidClassConstantOnString,
            Self::InvalidClassStringExpression,
            Self::InvalidClone,
            Self::InvalidConstantSelector,
            Self::InvalidConstantValue,
            Self::InvalidContinue,
            Self::InvalidDestructuringSource,
            Self::InvalidDocblock,
            Self::InvalidEnumCaseValue,
            Self::InvalidExtend,
            Self::InvalidForeachKey,
            Self::InvalidForeachValue,
            Self::InvalidGeneratorReturnType,
            Self::InvalidGlobal,
            Self::InvalidImplement,
            Self::InvalidIssetExpression,
            Self::InvalidIterator,
            Self::InvalidMemberSelector,
            Self::InvalidMethodAccess,
            Self::InvalidNamedArgument,
            Self::InvalidOperand,
            Self::InvalidOverrideAttribute,
            Self::InvalidParameterDefaultValue,
            Self::InvalidParentType,
            Self::InvalidPassByReference,
            Self::InvalidPropertyAccess,
            Self::InvalidPropertyAssignmentValue,
            Self::InvalidPropertyDefaultValue,
            Self::InvalidPropertyRead,
            Self::InvalidPropertyWrite,
            Self::InvalidReturnStatement,
            Self::InvalidScopeKeywordContext,
            Self::InvalidStaticMethodAccess,
            Self::InvalidStaticMethodCall,
            Self::InvalidStaticPropertyAccess,
            Self::InvalidTemplateParameter,
            Self::InvalidThrow,
            Self::InvalidTraitAliasModifier,
            Self::InvalidTraitUse,
            Self::InvalidTypeCast,
            Self::InvalidUnset,
            Self::InvalidYieldKeyType,
            Self::InvalidYieldValueType,
            Self::LessSpecificArgument,
            Self::LessSpecificNestedArgumentType,
            Self::LessSpecificNestedReturnStatement,
            Self::LessSpecificReturnStatement,
            Self::ListDestructureNegativeKey,
            Self::ListDestructureStringKey,
            Self::ListUsedInReadContext,
            Self::MatchArmAlwaysTrue,
            Self::MatchDefaultArmAlwaysExecuted,
            Self::MatchExpressionOnlyDefaultArm,
            Self::MatchNotExhaustive,
            Self::MatchSubjectTypeIsNever,
            Self::MethodAccessOnNull,
            Self::MismatchedArrayIndex,
            Self::MissingApiOrInternal,
            Self::MissingConstantType,
            Self::MissingConstructor,
            Self::MissingMagicMethod,
            Self::MissingOverrideAttribute,
            Self::MissingParameterType,
            Self::MissingPropertyType,
            Self::MissingRequiredInterface,
            Self::MissingRequiredParent,
            Self::MissingReturnStatement,
            Self::MissingReturnType,
            Self::MissingTemplateParameter,
            Self::MixedArgument,
            Self::MixedArrayAccess,
            Self::MixedArrayAssignment,
            Self::MixedArrayIndex,
            Self::MixedAssignment,
            Self::MixedClone,
            Self::MixedDestructuringShape,
            Self::MixedMethodAccess,
            Self::MixedOperand,
            Self::MixedPropertyAccess,
            Self::MixedPropertyTypeCoercion,
            Self::MixedReturnStatement,
            Self::NameAlreadyInUse,
            Self::NamedArgumentAfterPositional,
            Self::NamedArgumentNotAllowed,
            Self::NamedArgumentOverridesPositional,
            Self::NeverMatchingSwitchCase,
            Self::NeverReturn,
            Self::NoValidCatchTypeFound,
            Self::NoValue,
            Self::NonClassUsedAsAttribute,
            Self::NonDocumentedConstant,
            Self::NonDocumentedMethod,
            Self::NonDocumentedProperty,
            Self::NonExistentAttributeClass,
            Self::NonExistentCatchType,
            Self::NonExistentClass,
            Self::NonExistentClassConstant,
            Self::NonExistentClassLike,
            Self::NonExistentConstant,
            Self::NonExistentFunction,
            Self::NonExistentMethod,
            Self::NonExistentProperty,
            Self::NonExistentUseImport,
            Self::NonIterableObjectIteration,
            Self::NonStaticAbstractImplementation,
            Self::NullArgument,
            Self::NullArrayAccess,
            Self::NullArrayIndex,
            Self::NullDestructuringSource,
            Self::NullIterator,
            Self::NullOperand,
            Self::NullPropertyAccess,
            Self::NullableReturnStatement,
            Self::OverlyWideReturnType,
            Self::OverrideFinalConstant,
            Self::OverrideFinalMethod,
            Self::OverrideFinalProperty,
            Self::OverrideFinalPropertyHook,
            Self::ParadoxicalCondition,
            Self::ParentOutsideClassScope,
            Self::PossibleMethodAccessOnNull,
            Self::PossiblyArrayAppendOverflow,
            Self::PossiblyFalseArgument,
            Self::PossiblyFalseArrayAccess,
            Self::PossiblyFalseIterator,
            Self::PossiblyFalseOperand,
            Self::PossiblyInvalidArgument,
            Self::PossiblyInvalidArrayAccess,
            Self::PossiblyInvalidClone,
            Self::PossiblyInvalidIterator,
            Self::PossiblyInvalidOperand,
            Self::PossiblyInvalidPropertyWrite,
            Self::PossiblyNonExistentMethod,
            Self::PossiblyNonExistentProperty,
            Self::PossiblyNullArgument,
            Self::PossiblyNullArrayAccess,
            Self::PossiblyNullArrayIndex,
            Self::PossiblyNullDestructuringSource,
            Self::PossiblyNullIterator,
            Self::PossiblyNullOperand,
            Self::PossiblyNullPropertyAccess,
            Self::PossiblyStaticAccessOnInterface,
            Self::PossiblyUndefinedArrayIndex,
            Self::PossiblyUndefinedIntArrayIndex,
            Self::PossiblyUndefinedStringArrayIndex,
            Self::PossiblyUndefinedVariable,
            Self::PropertyTypeCoercion,
            Self::PsalmTrace,
            Self::RedundantCast,
            Self::RedundantComparison,
            Self::RedundantCondition,
            Self::RedundantDocblockType,
            Self::RedundantIssetCheck,
            Self::RedundantKeyCheck,
            Self::RedundantLogicalOperation,
            Self::RedundantNonnullEntryCheck,
            Self::RedundantNonnullTypeComparison,
            Self::RedundantNullCoalesce,
            Self::RedundantNullsafeOperator,
            Self::RedundantTypeComparison,
            Self::ReferenceConstraintViolation,
            Self::ReferenceReusedFromConfusingScope,
            Self::ReferenceToUndefinedVariable,
            Self::SelfOutsideClassScope,
            Self::SideEffectsInCondition,
            Self::SkipInKeyedDestructuring,
            Self::SpreadInDestructuring,
            Self::StaticAccessOnInterface,
            Self::StaticOutsideClassScope,
            Self::StringConstantSelector,
            Self::StringMemberSelector,
            Self::TemplateConstraintViolation,
            Self::TooFewArguments,
            Self::TooManyArguments,
            Self::TraitConstantOverride,
            Self::TraitInstantiation,
            Self::TypeConfirmation,
            Self::TypeInspection,
            Self::UnavailableClassConstant,
            Self::UnavailableClassLike,
            Self::UnavailableConstant,
            Self::UnavailableEnumCase,
            Self::UnavailableFunction,
            Self::UnavailableMethod,
            Self::UnavailableProperty,
            Self::UndefinedIntArrayIndex,
            Self::UndefinedStringArrayIndex,
            Self::UndefinedVariable,
            Self::UndefinedVariableInClosureUse,
            Self::UnevaluatedCode,
            Self::UnhandledThrownType,
            Self::UnimplementedAbstractMethod,
            Self::UnimplementedAbstractPropertyHook,
            Self::UninitializedProperty,
            Self::UnknownClassInstantiation,
            Self::UnknownConstantSelectorType,
            Self::UnknownIteratorType,
            Self::UnknownMatchSubjectType,
            Self::UnknownMemberSelectorType,
            Self::UnknownYieldFromIteratorType,
            Self::UnreachableElseClause,
            Self::UnreachableMatchArm,
            Self::UnreachableMatchDefaultArm,
            Self::UnreachableSwitchCase,
            Self::UnreachableSwitchDefault,
            Self::UnresolvableClassConstant,
            Self::UnsafeInstantiation,
            Self::UnusedFunctionCall,
            Self::UnusedMethod,
            Self::UnusedMethodCall,
            Self::UnusedParameter,
            Self::UnusedProperty,
            Self::UnusedStatement,
            Self::UnusedTemplateParameter,
            Self::UselessControlFlow,
            Self::WhereConstraintViolation,
            Self::WriteOnlyProperty,
            Self::YieldFromInvalidKeyType,
            Self::YieldFromInvalidSendType,
            Self::YieldFromInvalidValueType,
            Self::YieldFromNonIterable,
            Self::YieldOutsideFunction,
        ]
    }
}

impl std::str::FromStr for IssueCode {
    type Err = &'static str;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "abstract-class-used-as-attribute" => Ok(Self::AbstractClassUsedAsAttribute),
            "abstract-instantiation" => Ok(Self::AbstractInstantiation),
            "always-matching-switch-case" => Ok(Self::AlwaysMatchingSwitchCase),
            "ambiguous-class-like-constant-access" => Ok(Self::AmbiguousClassLikeConstantAccess),
            "ambiguous-instantiation-target" => Ok(Self::AmbiguousInstantiationTarget),
            "ambiguous-object-method-access" => Ok(Self::AmbiguousObjectMethodAccess),
            "ambiguous-object-property-access" => Ok(Self::AmbiguousObjectPropertyAccess),
            "array-append-in-read-context" => Ok(Self::ArrayAppendInReadContext),
            "array-append-overflow" => Ok(Self::ArrayAppendOverflow),
            "array-to-string-conversion" => Ok(Self::ArrayToStringConversion),
            "assignment-to-constant" => Ok(Self::AssignmentToConstant),
            "assignment-to-this" => Ok(Self::AssignmentToThis),
            "attribute-not-repeatable" => Ok(Self::AttributeNotRepeatable),
            "avoid-catching-error" => Ok(Self::AvoidCatchingError),
            "backed-property-reference-hook" => Ok(Self::BackedPropertyReferenceHook),
            "catch-type-not-throwable" => Ok(Self::CatchTypeNotThrowable),
            "class-must-be-final" => Ok(Self::ClassMustBeFinal),
            "class-not-marked-as-attribute" => Ok(Self::ClassNotMarkedAsAttribute),
            "clone-inside-loop" => Ok(Self::CloneInsideLoop),
            "condition-is-too-complex" => Ok(Self::ConditionIsTooComplex),
            "conflicting-reference-constraint" => Ok(Self::ConflictingReferenceConstraint),
            "conflicting-template-equality-bounds" => Ok(Self::ConflictingTemplateEqualityBounds),
            "deprecated-class" => Ok(Self::DeprecatedClass),
            "deprecated-closure" => Ok(Self::DeprecatedClosure),
            "deprecated-constant" => Ok(Self::DeprecatedConstant),
            "deprecated-feature" => Ok(Self::DeprecatedFeature),
            "deprecated-function" => Ok(Self::DeprecatedFunction),
            "deprecated-method" => Ok(Self::DeprecatedMethod),
            "deprecated-trait" => Ok(Self::DeprecatedTrait),
            "direct-trait-constant-access" => Ok(Self::DirectTraitConstantAccess),
            "docblock-parameter-narrowing" => Ok(Self::DocblockParameterNarrowing),
            "docblock-type-mismatch" => Ok(Self::DocblockTypeMismatch),
            "duplicate-array-key" => Ok(Self::DuplicateArrayKey),
            "duplicate-caught-type" => Ok(Self::DuplicateCaughtType),
            "duplicate-closure-use-variable" => Ok(Self::DuplicateClosureUseVariable),
            "duplicate-definition" => Ok(Self::DuplicateDefinition),
            "duplicate-enum-case-value" => Ok(Self::DuplicateEnumCaseValue),
            "duplicate-named-argument" => Ok(Self::DuplicateNamedArgument),
            "dynamic-static-method-call" => Ok(Self::DynamicStaticMethodCall),
            "empty-match-expression" => Ok(Self::EmptyMatchExpression),
            "enum-instantiation" => Ok(Self::EnumInstantiation),
            "enum-iteration" => Ok(Self::EnumIteration),
            "excess-template-parameter" => Ok(Self::ExcessTemplateParameter),
            "experimental-usage" => Ok(Self::ExperimentalUsage),
            "expression-is-too-complex" => Ok(Self::ExpressionIsTooComplex),
            "extend-final-class" => Ok(Self::ExtendFinalClass),
            "falsable-return-statement" => Ok(Self::FalsableReturnStatement),
            "false-argument" => Ok(Self::FalseArgument),
            "false-array-access" => Ok(Self::FalseArrayAccess),
            "false-iterator" => Ok(Self::FalseIterator),
            "false-operand" => Ok(Self::FalseOperand),
            "generic-object-iteration" => Ok(Self::GenericObjectIteration),
            "hidden-generator-return" => Ok(Self::HiddenGeneratorReturn),
            "implicit-resource-to-string-cast" => Ok(Self::ImplicitResourceToStringCast),
            "implicit-to-string-cast" => Ok(Self::ImplicitToStringCast),
            "impossible-array-access" => Ok(Self::ImpossibleArrayAccess),
            "impossible-array-assignment" => Ok(Self::ImpossibleArrayAssignment),
            "impossible-assignment" => Ok(Self::ImpossibleAssignment),
            "impossible-condition" => Ok(Self::ImpossibleCondition),
            "impossible-key-check" => Ok(Self::ImpossibleKeyCheck),
            "impossible-nonnull-entry-check" => Ok(Self::ImpossibleNonnullEntryCheck),
            "impossible-null-type-comparison" => Ok(Self::ImpossibleNullTypeComparison),
            "impossible-type-comparison" => Ok(Self::ImpossibleTypeComparison),
            "imprecise-type" => Ok(Self::ImpreciseType),
            "impure-construct" => Ok(Self::ImpureConstruct),
            "impure-static-variable" => Ok(Self::ImpureStaticVariable),
            "incompatible-constant-access" => Ok(Self::IncompatibleConstantAccess),
            "incompatible-constant-override" => Ok(Self::IncompatibleConstantOverride),
            "incompatible-constant-type" => Ok(Self::IncompatibleConstantType),
            "incompatible-constant-visibility" => Ok(Self::IncompatibleConstantVisibility),
            "incompatible-parameter-count" => Ok(Self::IncompatibleParameterCount),
            "incompatible-parameter-name" => Ok(Self::IncompatibleParameterName),
            "incompatible-parameter-type" => Ok(Self::IncompatibleParameterType),
            "incompatible-property-access" => Ok(Self::IncompatiblePropertyAccess),
            "incompatible-property-default" => Ok(Self::IncompatiblePropertyDefault),
            "incompatible-property-hook-parameter-type" => Ok(Self::IncompatiblePropertyHookParameterType),
            "incompatible-property-hook-signature" => Ok(Self::IncompatiblePropertyHookSignature),
            "incompatible-property-override" => Ok(Self::IncompatiblePropertyOverride),
            "incompatible-property-readonly" => Ok(Self::IncompatiblePropertyReadonly),
            "incompatible-property-static" => Ok(Self::IncompatiblePropertyStatic),
            "incompatible-property-type" => Ok(Self::IncompatiblePropertyType),
            "incompatible-property-visibility" => Ok(Self::IncompatiblePropertyVisibility),
            "incompatible-readonly-modifier" => Ok(Self::IncompatibleReadonlyModifier),
            "incompatible-return-type" => Ok(Self::IncompatibleReturnType),
            "incompatible-static-modifier" => Ok(Self::IncompatibleStaticModifier),
            "incompatible-template-lower-bound" => Ok(Self::IncompatibleTemplateLowerBound),
            "incompatible-visibility" => Ok(Self::IncompatibleVisibility),
            "inconsistent-template" => Ok(Self::InconsistentTemplate),
            "incorrect-class-like-casing" => Ok(Self::IncorrectClassLikeCasing),
            "incorrect-function-casing" => Ok(Self::IncorrectFunctionCasing),
            "interface-instantiation" => Ok(Self::InterfaceInstantiation),
            "invalid-argument" => Ok(Self::InvalidArgument),
            "invalid-array-access" => Ok(Self::InvalidArrayAccess),
            "invalid-array-access-assignment-value" => Ok(Self::InvalidArrayAccessAssignmentValue),
            "invalid-array-element" => Ok(Self::InvalidArrayElement),
            "invalid-array-element-key" => Ok(Self::InvalidArrayElementKey),
            "invalid-array-index" => Ok(Self::InvalidArrayIndex),
            "invalid-assignment" => Ok(Self::InvalidAssignment),
            "invalid-attribute-target" => Ok(Self::InvalidAttributeTarget),
            "invalid-break" => Ok(Self::InvalidBreak),
            "invalid-callable" => Ok(Self::InvalidCallable),
            "invalid-catch-type" => Ok(Self::InvalidCatchType),
            "invalid-catch-type-not-class-or-interface" => Ok(Self::InvalidCatchTypeNotClassOrInterface),
            "invalid-class-constant-on-string" => Ok(Self::InvalidClassConstantOnString),
            "invalid-class-string-expression" => Ok(Self::InvalidClassStringExpression),
            "invalid-clone" => Ok(Self::InvalidClone),
            "invalid-constant-selector" => Ok(Self::InvalidConstantSelector),
            "invalid-constant-value" => Ok(Self::InvalidConstantValue),
            "invalid-continue" => Ok(Self::InvalidContinue),
            "invalid-destructuring-source" => Ok(Self::InvalidDestructuringSource),
            "invalid-docblock" => Ok(Self::InvalidDocblock),
            "invalid-enum-case-value" => Ok(Self::InvalidEnumCaseValue),
            "invalid-extend" => Ok(Self::InvalidExtend),
            "invalid-foreach-key" => Ok(Self::InvalidForeachKey),
            "invalid-foreach-value" => Ok(Self::InvalidForeachValue),
            "invalid-generator-return-type" => Ok(Self::InvalidGeneratorReturnType),
            "invalid-global" => Ok(Self::InvalidGlobal),
            "invalid-implement" => Ok(Self::InvalidImplement),
            "invalid-isset-expression" => Ok(Self::InvalidIssetExpression),
            "invalid-iterator" => Ok(Self::InvalidIterator),
            "invalid-member-selector" => Ok(Self::InvalidMemberSelector),
            "invalid-method-access" => Ok(Self::InvalidMethodAccess),
            "invalid-named-argument" => Ok(Self::InvalidNamedArgument),
            "invalid-operand" => Ok(Self::InvalidOperand),
            "invalid-override-attribute" => Ok(Self::InvalidOverrideAttribute),
            "invalid-parameter-default-value" => Ok(Self::InvalidParameterDefaultValue),
            "invalid-parent-type" => Ok(Self::InvalidParentType),
            "invalid-pass-by-reference" => Ok(Self::InvalidPassByReference),
            "invalid-property-access" => Ok(Self::InvalidPropertyAccess),
            "invalid-property-assignment-value" => Ok(Self::InvalidPropertyAssignmentValue),
            "invalid-property-default-value" => Ok(Self::InvalidPropertyDefaultValue),
            "invalid-property-read" => Ok(Self::InvalidPropertyRead),
            "invalid-property-write" => Ok(Self::InvalidPropertyWrite),
            "invalid-return-statement" => Ok(Self::InvalidReturnStatement),
            "invalid-scope-keyword-context" => Ok(Self::InvalidScopeKeywordContext),
            "invalid-static-method-access" => Ok(Self::InvalidStaticMethodAccess),
            "invalid-static-method-call" => Ok(Self::InvalidStaticMethodCall),
            "invalid-static-property-access" => Ok(Self::InvalidStaticPropertyAccess),
            "invalid-template-parameter" => Ok(Self::InvalidTemplateParameter),
            "invalid-throw" => Ok(Self::InvalidThrow),
            "invalid-trait-alias-modifier" => Ok(Self::InvalidTraitAliasModifier),
            "invalid-trait-use" => Ok(Self::InvalidTraitUse),
            "invalid-type-cast" => Ok(Self::InvalidTypeCast),
            "invalid-unset" => Ok(Self::InvalidUnset),
            "invalid-yield-key-type" => Ok(Self::InvalidYieldKeyType),
            "invalid-yield-value-type" => Ok(Self::InvalidYieldValueType),
            "less-specific-argument" => Ok(Self::LessSpecificArgument),
            "less-specific-nested-argument-type" => Ok(Self::LessSpecificNestedArgumentType),
            "less-specific-nested-return-statement" => Ok(Self::LessSpecificNestedReturnStatement),
            "less-specific-return-statement" => Ok(Self::LessSpecificReturnStatement),
            "list-destructure-negative-key" => Ok(Self::ListDestructureNegativeKey),
            "list-destructure-string-key" => Ok(Self::ListDestructureStringKey),
            "list-used-in-read-context" => Ok(Self::ListUsedInReadContext),
            "match-arm-always-true" => Ok(Self::MatchArmAlwaysTrue),
            "match-default-arm-always-executed" => Ok(Self::MatchDefaultArmAlwaysExecuted),
            "match-expression-only-default-arm" => Ok(Self::MatchExpressionOnlyDefaultArm),
            "match-not-exhaustive" => Ok(Self::MatchNotExhaustive),
            "match-subject-type-is-never" => Ok(Self::MatchSubjectTypeIsNever),
            "method-access-on-null" => Ok(Self::MethodAccessOnNull),
            "mismatched-array-index" => Ok(Self::MismatchedArrayIndex),
            "missing-api-or-internal" => Ok(Self::MissingApiOrInternal),
            "missing-constant-type" => Ok(Self::MissingConstantType),
            "missing-constructor" => Ok(Self::MissingConstructor),
            "missing-magic-method" => Ok(Self::MissingMagicMethod),
            "missing-override-attribute" => Ok(Self::MissingOverrideAttribute),
            "missing-parameter-type" => Ok(Self::MissingParameterType),
            "missing-property-type" => Ok(Self::MissingPropertyType),
            "missing-required-interface" => Ok(Self::MissingRequiredInterface),
            "missing-required-parent" => Ok(Self::MissingRequiredParent),
            "missing-return-statement" => Ok(Self::MissingReturnStatement),
            "missing-return-type" => Ok(Self::MissingReturnType),
            "missing-template-parameter" => Ok(Self::MissingTemplateParameter),
            "mixed-argument" => Ok(Self::MixedArgument),
            "mixed-array-access" => Ok(Self::MixedArrayAccess),
            "mixed-array-assignment" => Ok(Self::MixedArrayAssignment),
            "mixed-array-index" => Ok(Self::MixedArrayIndex),
            "mixed-assignment" => Ok(Self::MixedAssignment),
            "mixed-clone" => Ok(Self::MixedClone),
            "mixed-destructuring-shape" => Ok(Self::MixedDestructuringShape),
            "mixed-method-access" => Ok(Self::MixedMethodAccess),
            "mixed-operand" => Ok(Self::MixedOperand),
            "mixed-property-access" => Ok(Self::MixedPropertyAccess),
            "mixed-property-type-coercion" => Ok(Self::MixedPropertyTypeCoercion),
            "mixed-return-statement" => Ok(Self::MixedReturnStatement),
            "name-already-in-use" => Ok(Self::NameAlreadyInUse),
            "named-argument-after-positional" => Ok(Self::NamedArgumentAfterPositional),
            "named-argument-not-allowed" => Ok(Self::NamedArgumentNotAllowed),
            "named-argument-overrides-positional" => Ok(Self::NamedArgumentOverridesPositional),
            "never-matching-switch-case" => Ok(Self::NeverMatchingSwitchCase),
            "never-return" => Ok(Self::NeverReturn),
            "no-valid-catch-type-found" => Ok(Self::NoValidCatchTypeFound),
            "no-value" => Ok(Self::NoValue),
            "non-class-used-as-attribute" => Ok(Self::NonClassUsedAsAttribute),
            "non-documented-constant" => Ok(Self::NonDocumentedConstant),
            "non-documented-method" => Ok(Self::NonDocumentedMethod),
            "non-documented-property" => Ok(Self::NonDocumentedProperty),
            "non-existent-attribute-class" => Ok(Self::NonExistentAttributeClass),
            "non-existent-catch-type" => Ok(Self::NonExistentCatchType),
            "non-existent-class" => Ok(Self::NonExistentClass),
            "non-existent-class-constant" => Ok(Self::NonExistentClassConstant),
            "non-existent-class-like" => Ok(Self::NonExistentClassLike),
            "non-existent-constant" => Ok(Self::NonExistentConstant),
            "non-existent-function" => Ok(Self::NonExistentFunction),
            "non-existent-method" => Ok(Self::NonExistentMethod),
            "non-existent-property" => Ok(Self::NonExistentProperty),
            "non-existent-use-import" => Ok(Self::NonExistentUseImport),
            "non-iterable-object-iteration" => Ok(Self::NonIterableObjectIteration),
            "non-static-abstract-implementation" => Ok(Self::NonStaticAbstractImplementation),
            "null-argument" => Ok(Self::NullArgument),
            "null-array-access" => Ok(Self::NullArrayAccess),
            "null-array-index" => Ok(Self::NullArrayIndex),
            "null-destructuring-source" => Ok(Self::NullDestructuringSource),
            "null-iterator" => Ok(Self::NullIterator),
            "null-operand" => Ok(Self::NullOperand),
            "null-property-access" => Ok(Self::NullPropertyAccess),
            "nullable-return-statement" => Ok(Self::NullableReturnStatement),
            "overly-wide-return-type" => Ok(Self::OverlyWideReturnType),
            "override-final-constant" => Ok(Self::OverrideFinalConstant),
            "override-final-method" => Ok(Self::OverrideFinalMethod),
            "override-final-property" => Ok(Self::OverrideFinalProperty),
            "override-final-property-hook" => Ok(Self::OverrideFinalPropertyHook),
            "paradoxical-condition" => Ok(Self::ParadoxicalCondition),
            "parent-outside-class-scope" => Ok(Self::ParentOutsideClassScope),
            "possible-method-access-on-null" => Ok(Self::PossibleMethodAccessOnNull),
            "possibly-array-append-overflow" => Ok(Self::PossiblyArrayAppendOverflow),
            "possibly-false-argument" => Ok(Self::PossiblyFalseArgument),
            "possibly-false-array-access" => Ok(Self::PossiblyFalseArrayAccess),
            "possibly-false-iterator" => Ok(Self::PossiblyFalseIterator),
            "possibly-false-operand" => Ok(Self::PossiblyFalseOperand),
            "possibly-invalid-argument" => Ok(Self::PossiblyInvalidArgument),
            "possibly-invalid-array-access" => Ok(Self::PossiblyInvalidArrayAccess),
            "possibly-invalid-clone" => Ok(Self::PossiblyInvalidClone),
            "possibly-invalid-iterator" => Ok(Self::PossiblyInvalidIterator),
            "possibly-invalid-operand" => Ok(Self::PossiblyInvalidOperand),
            "possibly-invalid-property-write" => Ok(Self::PossiblyInvalidPropertyWrite),
            "possibly-non-existent-method" => Ok(Self::PossiblyNonExistentMethod),
            "possibly-non-existent-property" => Ok(Self::PossiblyNonExistentProperty),
            "possibly-null-argument" => Ok(Self::PossiblyNullArgument),
            "possibly-null-array-access" => Ok(Self::PossiblyNullArrayAccess),
            "possibly-null-array-index" => Ok(Self::PossiblyNullArrayIndex),
            "possibly-null-destructuring-source" => Ok(Self::PossiblyNullDestructuringSource),
            "possibly-null-iterator" => Ok(Self::PossiblyNullIterator),
            "possibly-null-operand" => Ok(Self::PossiblyNullOperand),
            "possibly-null-property-access" => Ok(Self::PossiblyNullPropertyAccess),
            "possibly-static-access-on-interface" => Ok(Self::PossiblyStaticAccessOnInterface),
            "possibly-undefined-array-index" => Ok(Self::PossiblyUndefinedArrayIndex),
            "possibly-undefined-int-array-index" => Ok(Self::PossiblyUndefinedIntArrayIndex),
            "possibly-undefined-string-array-index" => Ok(Self::PossiblyUndefinedStringArrayIndex),
            "possibly-undefined-variable" => Ok(Self::PossiblyUndefinedVariable),
            "property-type-coercion" => Ok(Self::PropertyTypeCoercion),
            "psalm-trace" => Ok(Self::PsalmTrace),
            "redundant-cast" => Ok(Self::RedundantCast),
            "redundant-comparison" => Ok(Self::RedundantComparison),
            "redundant-condition" => Ok(Self::RedundantCondition),
            "redundant-docblock-type" => Ok(Self::RedundantDocblockType),
            "redundant-isset-check" => Ok(Self::RedundantIssetCheck),
            "redundant-key-check" => Ok(Self::RedundantKeyCheck),
            "redundant-logical-operation" => Ok(Self::RedundantLogicalOperation),
            "redundant-nonnull-entry-check" => Ok(Self::RedundantNonnullEntryCheck),
            "redundant-nonnull-type-comparison" => Ok(Self::RedundantNonnullTypeComparison),
            "redundant-null-coalesce" => Ok(Self::RedundantNullCoalesce),
            "redundant-nullsafe-operator" => Ok(Self::RedundantNullsafeOperator),
            "redundant-type-comparison" => Ok(Self::RedundantTypeComparison),
            "reference-constraint-violation" => Ok(Self::ReferenceConstraintViolation),
            "reference-reused-from-confusing-scope" => Ok(Self::ReferenceReusedFromConfusingScope),
            "reference-to-undefined-variable" => Ok(Self::ReferenceToUndefinedVariable),
            "self-outside-class-scope" => Ok(Self::SelfOutsideClassScope),
            "side-effects-in-condition" => Ok(Self::SideEffectsInCondition),
            "skip-in-keyed-destructuring" => Ok(Self::SkipInKeyedDestructuring),
            "spread-in-destructuring" => Ok(Self::SpreadInDestructuring),
            "static-access-on-interface" => Ok(Self::StaticAccessOnInterface),
            "static-outside-class-scope" => Ok(Self::StaticOutsideClassScope),
            "string-constant-selector" => Ok(Self::StringConstantSelector),
            "string-member-selector" => Ok(Self::StringMemberSelector),
            "template-constraint-violation" => Ok(Self::TemplateConstraintViolation),
            "too-few-arguments" => Ok(Self::TooFewArguments),
            "too-many-arguments" => Ok(Self::TooManyArguments),
            "trait-constant-override" => Ok(Self::TraitConstantOverride),
            "trait-instantiation" => Ok(Self::TraitInstantiation),
            "type-confirmation" => Ok(Self::TypeConfirmation),
            "type-inspection" => Ok(Self::TypeInspection),
            "unavailable-class-constant" => Ok(Self::UnavailableClassConstant),
            "unavailable-class-like" => Ok(Self::UnavailableClassLike),
            "unavailable-constant" => Ok(Self::UnavailableConstant),
            "unavailable-enum-case" => Ok(Self::UnavailableEnumCase),
            "unavailable-function" => Ok(Self::UnavailableFunction),
            "unavailable-method" => Ok(Self::UnavailableMethod),
            "unavailable-property" => Ok(Self::UnavailableProperty),
            "undefined-int-array-index" => Ok(Self::UndefinedIntArrayIndex),
            "undefined-string-array-index" => Ok(Self::UndefinedStringArrayIndex),
            "undefined-variable" => Ok(Self::UndefinedVariable),
            "undefined-variable-in-closure-use" => Ok(Self::UndefinedVariableInClosureUse),
            "unevaluated-code" => Ok(Self::UnevaluatedCode),
            "unhandled-thrown-type" => Ok(Self::UnhandledThrownType),
            "unimplemented-abstract-method" => Ok(Self::UnimplementedAbstractMethod),
            "unimplemented-abstract-property-hook" => Ok(Self::UnimplementedAbstractPropertyHook),
            "uninitialized-property" => Ok(Self::UninitializedProperty),
            "unknown-class-instantiation" => Ok(Self::UnknownClassInstantiation),
            "unknown-constant-selector-type" => Ok(Self::UnknownConstantSelectorType),
            "unknown-iterator-type" => Ok(Self::UnknownIteratorType),
            "unknown-match-subject-type" => Ok(Self::UnknownMatchSubjectType),
            "unknown-member-selector-type" => Ok(Self::UnknownMemberSelectorType),
            "unknown-yield-from-iterator-type" => Ok(Self::UnknownYieldFromIteratorType),
            "unreachable-else-clause" => Ok(Self::UnreachableElseClause),
            "unreachable-match-arm" => Ok(Self::UnreachableMatchArm),
            "unreachable-match-default-arm" => Ok(Self::UnreachableMatchDefaultArm),
            "unreachable-switch-case" => Ok(Self::UnreachableSwitchCase),
            "unreachable-switch-default" => Ok(Self::UnreachableSwitchDefault),
            "unresolvable-class-constant" => Ok(Self::UnresolvableClassConstant),
            "unsafe-instantiation" => Ok(Self::UnsafeInstantiation),
            "unused-function-call" => Ok(Self::UnusedFunctionCall),
            "unused-method" => Ok(Self::UnusedMethod),
            "unused-method-call" => Ok(Self::UnusedMethodCall),
            "unused-parameter" => Ok(Self::UnusedParameter),
            "unused-property" => Ok(Self::UnusedProperty),
            "unused-statement" => Ok(Self::UnusedStatement),
            "unused-template-parameter" => Ok(Self::UnusedTemplateParameter),
            "useless-control-flow" => Ok(Self::UselessControlFlow),
            "where-constraint-violation" => Ok(Self::WhereConstraintViolation),
            "write-only-property" => Ok(Self::WriteOnlyProperty),
            "yield-from-invalid-key-type" => Ok(Self::YieldFromInvalidKeyType),
            "yield-from-invalid-send-type" => Ok(Self::YieldFromInvalidSendType),
            "yield-from-invalid-value-type" => Ok(Self::YieldFromInvalidValueType),
            "yield-from-non-iterable" => Ok(Self::YieldFromNonIterable),
            "yield-outside-function" => Ok(Self::YieldOutsideFunction),
            _ => Err("unknown issue code"),
        }
    }
}

impl std::fmt::Display for IssueCode {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl std::convert::TryFrom<&str> for IssueCode {
    type Error = &'static str;

    fn try_from(value: &str) -> Result<Self, Self::Error> {
        <Self as std::str::FromStr>::from_str(value)
    }
}

impl std::convert::From<IssueCode> for &'static str {
    fn from(val: IssueCode) -> Self {
        val.as_str()
    }
}

impl std::convert::From<IssueCode> for String {
    fn from(val: IssueCode) -> Self {
        val.as_str().to_string()
    }
}

impl std::borrow::Borrow<str> for IssueCode {
    fn borrow(&self) -> &'static str {
        self.as_str()
    }
}

impl<'code> std::borrow::Borrow<str> for &'code IssueCode {
    fn borrow(&self) -> &'code str {
        self.as_str()
    }
}