Skip to content

Commit 0deffb7

Browse files
committed
Implement RestrictedClassNameUsageExtension
1 parent 15f1d89 commit 0deffb7

14 files changed

+308
-502
lines changed

phpstan-baseline.neon

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Accessing PHPStan\\Rules\\Classes\\ExistingClassesInClassImplementsRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#'
5+
identifier: phpstanApi.classConstant
6+
count: 1
7+
path: tests/Rules/Deprecations/ImplementationOfDeprecatedInterfaceRuleTest.php
8+
9+
-
10+
message: '#^Accessing PHPStan\\Rules\\Classes\\ExistingClassInClassExtendsRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#'
11+
identifier: phpstanApi.classConstant
12+
count: 1
13+
path: tests/Rules/Deprecations/InheritanceOfDeprecatedClassRuleTest.php
14+
15+
-
16+
message: '#^Accessing PHPStan\\Rules\\Classes\\ExistingClassesInInterfaceExtendsRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#'
17+
identifier: phpstanApi.classConstant
18+
count: 1
19+
path: tests/Rules/Deprecations/InheritanceOfDeprecatedInterfaceRuleTest.php
20+
21+
-
22+
message: '#^Accessing PHPStan\\Rules\\Classes\\InstantiationRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#'
23+
identifier: phpstanApi.classConstant
24+
count: 1
25+
path: tests/Rules/Deprecations/InstantiationOfDeprecatedClassRuleTest.php
26+
27+
-
28+
message: '#^Accessing PHPStan\\Rules\\Classes\\ExistingClassInTraitUseRule\:\:class is not covered by backward compatibility promise\. The class might change in a minor PHPStan version\.$#'
29+
identifier: phpstanApi.classConstant
30+
count: 1
31+
path: tests/Rules/Deprecations/UsageOfDeprecatedTraitRuleTest.php

phpstan.neon

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
includes:
2+
- phpstan-baseline.neon
23
- rules.neon
34
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
45
- vendor/phpstan/phpstan-phpunit/extension.neon

rules.neon

+7-5
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,23 @@ services:
2424
tags:
2525
- phpstan.restrictedMethodUsageExtension
2626

27+
-
28+
class: PHPStan\Rules\Deprecations\RestrictedDeprecatedClassNameUsageExtension
29+
arguments:
30+
bleedingEdge: %featureToggles.bleedingEdge%
31+
tags:
32+
- phpstan.restrictedClassNameUsageExtension
33+
2734
rules:
2835
- PHPStan\Rules\Deprecations\AccessDeprecatedPropertyRule
2936
- PHPStan\Rules\Deprecations\AccessDeprecatedStaticPropertyRule
3037
- PHPStan\Rules\Deprecations\CallToDeprecatedFunctionRule
3138
- PHPStan\Rules\Deprecations\FetchingClassConstOfDeprecatedClassRule
3239
- PHPStan\Rules\Deprecations\FetchingDeprecatedConstRule
33-
- PHPStan\Rules\Deprecations\ImplementationOfDeprecatedInterfaceRule
34-
- PHPStan\Rules\Deprecations\InheritanceOfDeprecatedClassRule
35-
- PHPStan\Rules\Deprecations\InheritanceOfDeprecatedInterfaceRule
36-
- PHPStan\Rules\Deprecations\InstantiationOfDeprecatedClassRule
3740
- PHPStan\Rules\Deprecations\TypeHintDeprecatedInClassMethodSignatureRule
3841
- PHPStan\Rules\Deprecations\TypeHintDeprecatedInClosureSignatureRule
3942
- PHPStan\Rules\Deprecations\TypeHintDeprecatedInFunctionSignatureRule
4043
- PHPStan\Rules\Deprecations\UsageOfDeprecatedCastRule
41-
- PHPStan\Rules\Deprecations\UsageOfDeprecatedTraitRule
4244

4345
conditionalTags:
4446
PHPStan\Rules\Deprecations\CallWithDeprecatedIniOptionRule:

src/Rules/Deprecations/ImplementationOfDeprecatedInterfaceRule.php

-103
This file was deleted.

src/Rules/Deprecations/InheritanceOfDeprecatedClassRule.php

-100
This file was deleted.

src/Rules/Deprecations/InheritanceOfDeprecatedInterfaceRule.php

-83
This file was deleted.

0 commit comments

Comments
 (0)