99use PHPStan \Type \Type ;
1010use function array_map ;
1111use function count ;
12- use function sprintf ;
13- use function strpos ;
1412
1513/**
1614 * @extends AbstractPluginManagerRule<ClassMethod>
@@ -43,7 +41,6 @@ public function processNode(Node $node, Scope $scope): array
4341 }
4442
4543 $ hasCacheBackendSet = false ;
46- $ misnamedCacheTagWarnings = [];
4744
4845 foreach ($ node ->stmts ?? [] as $ statement ) {
4946 if ($ statement instanceof Node \Stmt \Expression) {
@@ -67,21 +64,6 @@ public function processNode(Node $node, Scope $scope): array
6764 continue ;
6865 }
6966
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-
8567 break ;
8668 }
8769 }
@@ -90,9 +72,6 @@ public function processNode(Node $node, Scope $scope): array
9072 if (!$ hasCacheBackendSet ) {
9173 $ errors [] = 'Missing cache backend declaration for performance. ' ;
9274 }
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- }
9675
9776 return $ errors ;
9877 }
0 commit comments