9
9
use PHPStan \Type \Type ;
10
10
use function array_map ;
11
11
use function count ;
12
- use function sprintf ;
13
- use function strpos ;
14
12
15
13
/**
16
14
* @extends AbstractPluginManagerRule<ClassMethod>
@@ -43,7 +41,6 @@ public function processNode(Node $node, Scope $scope): array
43
41
}
44
42
45
43
$ hasCacheBackendSet = false ;
46
- $ misnamedCacheTagWarnings = [];
47
44
48
45
foreach ($ node ->stmts ?? [] as $ statement ) {
49
46
if ($ statement instanceof Node \Stmt \Expression) {
@@ -67,21 +64,6 @@ public function processNode(Node $node, Scope $scope): array
67
64
continue ;
68
65
}
69
66
70
- if (isset ($ setCacheBackendArgs [2 ])) {
71
- $ cacheTagsType = $ scope ->getType ($ setCacheBackendArgs [2 ]->value );
72
- foreach ($ cacheTagsType ->getConstantArrays () as $ constantArray ) {
73
- foreach ($ constantArray ->getValueTypes () as $ valueType ) {
74
- foreach ($ valueType ->getConstantStrings () as $ cacheTagConstantString ) {
75
- foreach ($ cacheKey as $ cacheKeyValue ) {
76
- if (strpos ($ cacheTagConstantString ->getValue (), $ cacheKeyValue ) === false ) {
77
- $ misnamedCacheTagWarnings [] = $ cacheTagConstantString ->getValue ();
78
- }
79
- }
80
- }
81
- }
82
- }
83
- }
84
-
85
67
break ;
86
68
}
87
69
}
@@ -90,9 +72,6 @@ public function processNode(Node $node, Scope $scope): array
90
72
if (!$ hasCacheBackendSet ) {
91
73
$ errors [] = 'Missing cache backend declaration for performance. ' ;
92
74
}
93
- foreach ($ misnamedCacheTagWarnings as $ cacheTagWarning ) {
94
- $ errors [] = sprintf ('%s cache tag might be unclear and does not contain the cache key in it. ' , $ cacheTagWarning );
95
- }
96
75
97
76
return $ errors ;
98
77
}
0 commit comments