|
47 | 47 | use PHPStan\Rules\Generics\ClassAncestorsRule;
|
48 | 48 | use PHPStan\Rules\Generics\ClassTemplateTypeRule;
|
49 | 49 | use PHPStan\Rules\Generics\CrossCheckInterfacesHelper;
|
| 50 | +use PHPStan\Rules\Generics\EnumAncestorsRule; |
| 51 | +use PHPStan\Rules\Generics\EnumTemplateTypeRule; |
50 | 52 | use PHPStan\Rules\Generics\FunctionSignatureVarianceRule;
|
51 | 53 | use PHPStan\Rules\Generics\FunctionTemplateTypeRule;
|
52 | 54 | use PHPStan\Rules\Generics\GenericAncestorsCheck;
|
|
58 | 60 | use PHPStan\Rules\Generics\MethodTagTemplateTypeRule;
|
59 | 61 | use PHPStan\Rules\Generics\MethodTagTemplateTypeTraitRule;
|
60 | 62 | use PHPStan\Rules\Generics\MethodTemplateTypeRule;
|
| 63 | +use PHPStan\Rules\Generics\PropertyVarianceRule; |
61 | 64 | use PHPStan\Rules\Generics\TemplateTypeCheck;
|
62 | 65 | use PHPStan\Rules\Generics\TraitTemplateTypeRule;
|
| 66 | +use PHPStan\Rules\Generics\UsedTraitsRule; |
63 | 67 | use PHPStan\Rules\Generics\VarianceCheck;
|
64 | 68 | use PHPStan\Rules\Methods\ExistingClassesInTypehintsRule;
|
65 | 69 | use PHPStan\Rules\Methods\MethodParameterComparisonHelper;
|
|
69 | 73 | use PHPStan\Rules\Methods\MissingMethodSelfOutTypeRule;
|
70 | 74 | use PHPStan\Rules\Methods\OverridingMethodRule;
|
71 | 75 | use PHPStan\Rules\MissingTypehintCheck;
|
| 76 | +use PHPStan\Rules\PhpDoc\AssertRuleHelper; |
| 77 | +use PHPStan\Rules\PhpDoc\ConditionalReturnTypeRuleHelper; |
| 78 | +use PHPStan\Rules\PhpDoc\FunctionAssertRule; |
| 79 | +use PHPStan\Rules\PhpDoc\FunctionConditionalReturnTypeRule; |
72 | 80 | use PHPStan\Rules\PhpDoc\GenericCallableRuleHelper;
|
73 | 81 | use PHPStan\Rules\PhpDoc\IncompatibleClassConstantPhpDocTypeRule;
|
74 | 82 | use PHPStan\Rules\PhpDoc\IncompatibleParamImmediatelyInvokedCallableRule;
|
|
78 | 86 | use PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule;
|
79 | 87 | use PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule;
|
80 | 88 | use PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule;
|
| 89 | +use PHPStan\Rules\PhpDoc\MethodAssertRule; |
| 90 | +use PHPStan\Rules\PhpDoc\MethodConditionalReturnTypeRule; |
81 | 91 | use PHPStan\Rules\PhpDoc\UnresolvableTypeHelper;
|
82 | 92 | use PHPStan\Rules\Properties\ExistingClassesInPropertiesRule;
|
83 | 93 | use PHPStan\Rules\Properties\MissingPropertyTypehintRule;
|
@@ -186,6 +196,8 @@ private function getRuleRegistry(Container $container): RuleRegistry
|
186 | 196 | $propertyTagCheck = new PropertyTagCheck($reflectionProvider, $classNameCheck, $genericObjectTypeCheck, $missingTypehintCheck, $unresolvableTypeHelper, true, true);
|
187 | 197 | $reflector = $container->getService('stubReflector');
|
188 | 198 | $relativePathHelper = $container->getService('simpleRelativePathHelper');
|
| 199 | + $assertRuleHelper = $container->getByType(AssertRuleHelper::class); |
| 200 | + $conditionalReturnTypeRuleHelper = $container->getByType(ConditionalReturnTypeRuleHelper::class); |
189 | 201 |
|
190 | 202 | $rules = [
|
191 | 203 | // level 0
|
@@ -237,6 +249,14 @@ private function getRuleRegistry(Container $container): RuleRegistry
|
237 | 249 | new PropertyTagRule($propertyTagCheck),
|
238 | 250 | new PropertyTagTraitRule($propertyTagCheck, $reflectionProvider),
|
239 | 251 | new PropertyTagTraitUseRule($propertyTagCheck),
|
| 252 | + new EnumAncestorsRule($genericAncestorsCheck, $crossCheckInterfacesHelper), |
| 253 | + new EnumTemplateTypeRule(), |
| 254 | + new PropertyVarianceRule($varianceCheck), |
| 255 | + new UsedTraitsRule($fileTypeMapper, $genericAncestorsCheck), |
| 256 | + new FunctionAssertRule($assertRuleHelper), |
| 257 | + new MethodAssertRule($assertRuleHelper), |
| 258 | + new FunctionConditionalReturnTypeRule($conditionalReturnTypeRuleHelper), |
| 259 | + new MethodConditionalReturnTypeRule($conditionalReturnTypeRuleHelper), |
240 | 260 |
|
241 | 261 | // level 6
|
242 | 262 | new MissingFunctionParameterTypehintRule($missingTypehintCheck),
|
|
0 commit comments