1010use PHPStan \Type \Type ;
1111use function array_map ;
1212use function count ;
13- use function sprintf ;
14- use function strpos ;
1513
1614/**
1715 * @extends AbstractPluginManagerRule<ClassMethod>
@@ -44,7 +42,6 @@ public function processNode(Node $node, Scope $scope): array
4442 }
4543
4644 $ hasCacheBackendSet = false ;
47- $ misnamedCacheTagWarnings = [];
4845
4946 foreach ($ node ->stmts ?? [] as $ statement ) {
5047 if ($ statement instanceof Node \Stmt \Expression) {
@@ -68,21 +65,6 @@ public function processNode(Node $node, Scope $scope): array
6865 continue ;
6966 }
7067
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-
8668 break ;
8769 }
8870 }
@@ -93,13 +75,6 @@ public function processNode(Node $node, Scope $scope): array
9375 ->identifier ('pluginManagerSetsCacheBackend.missingCacheBackend ' )
9476 ->build ();
9577 }
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- }
10378
10479 return $ errors ;
10580 }
0 commit comments