Skip to content

Commit c3905a7

Browse files
authored
[CLEANUP] Use RuleSet::removeMatchingRules() in tests (#1254)
Now this method has been added, using it appropriately in the tests, rather than the deprecated functionality, will eliminate a PHPStan warning. Note that PHPStan seems to erroneously place the warning against the callee rather than the caller.
1 parent 807a11b commit c3905a7

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ parameters:
5454
count: 1
5555
path: ../src/RuleSet/DeclarationBlock.php
5656

57-
-
58-
message: '#^Parameters should have "string" types as the only types passed to this method$#'
59-
identifier: typePerfect.narrowPublicClassMethodParamType
60-
count: 1
61-
path: ../src/RuleSet/RuleSet.php
62-
6357
-
6458
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
6559
identifier: notEqual.notAllowed

tests/ParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public function manipulation(): void
348348
$document->render()
349349
);
350350
foreach ($document->getAllRuleSets() as $ruleSet) {
351-
$ruleSet->removeRule('font-');
351+
$ruleSet->removeMatchingRules('font-');
352352
}
353353
self::assertSame(
354354
'#header {margin: 10px 2em 1cm 2%;color: red !important;background-color: green;'
@@ -357,7 +357,7 @@ public function manipulation(): void
357357
$document->render()
358358
);
359359
foreach ($document->getAllRuleSets() as $ruleSet) {
360-
$ruleSet->removeRule('background-');
360+
$ruleSet->removeMatchingRules('background-');
361361
}
362362
self::assertSame(
363363
'#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;transform: rotate(1turn);}

0 commit comments

Comments
 (0)