9
9
use PHPStan \Rules \Rule ;
10
10
use PHPStan \Rules \RuleErrorBuilder ;
11
11
use function sprintf ;
12
- use const PHP_VERSION_ID ;
13
12
14
13
/**
15
14
* @implements Rule<ConstFetch>
@@ -23,19 +22,10 @@ class FetchingDeprecatedConstRule implements Rule
23
22
/** @var DeprecatedScopeHelper */
24
23
private $ deprecatedScopeHelper ;
25
24
26
- /** @var array<string,string> */
27
- private $ deprecatedConstants = [];
28
-
29
25
public function __construct (ReflectionProvider $ reflectionProvider , DeprecatedScopeHelper $ deprecatedScopeHelper )
30
26
{
31
27
$ this ->reflectionProvider = $ reflectionProvider ;
32
28
$ this ->deprecatedScopeHelper = $ deprecatedScopeHelper ;
33
-
34
- // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed
35
- if (PHP_VERSION_ID >= 70300 ) {
36
- $ this ->deprecatedConstants ['FILTER_FLAG_SCHEME_REQUIRED ' ] = 'Use of constant %s is deprecated since PHP 7.3. ' ;
37
- $ this ->deprecatedConstants ['FILTER_FLAG_HOST_REQUIRED ' ] = 'Use of constant %s is deprecated since PHP 7.3. ' ;
38
- }
39
29
}
40
30
41
31
public function getNodeType (): string
@@ -64,15 +54,6 @@ public function processNode(Node $node, Scope $scope): array
64
54
];
65
55
}
66
56
67
- if (isset ($ this ->deprecatedConstants [$ constantReflection ->getName ()])) {
68
- return [
69
- RuleErrorBuilder::message (sprintf (
70
- $ this ->deprecatedConstants [$ constantReflection ->getName ()],
71
- $ constantReflection ->getName ()
72
- ))->identifier ('constant.deprecated ' )->build (),
73
- ];
74
- }
75
-
76
57
return [];
77
58
}
78
59
0 commit comments