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