diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 007667a5..f84a4a00 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -54,12 +54,6 @@ parameters: count: 1 path: ../src/RuleSet/DeclarationBlock.php - - - message: '#^Only booleans are allowed in a negated boolean, string\|null given\.$#' - identifier: booleanNot.exprNotBoolean - count: 2 - path: ../src/RuleSet/RuleSet.php - - message: '#^Parameters should have "string" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 3a7552e3..b10d3e97 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -149,7 +149,7 @@ public function getRules($searchPattern = null): array // Either no search rule is given or the search rule matches the found rule exactly // or the search rule ends in “-” and the found rule starts with the search rule. if ( - !$searchPattern || $propertyName === $searchPattern + $searchPattern === null || $propertyName === $searchPattern || ( \strrpos($searchPattern, '-') === \strlen($searchPattern) - \strlen('-') && (\strpos($propertyName, $searchPattern) === 0 @@ -240,7 +240,7 @@ public function removeRule($searchPattern): void // or the search rule ends in “-” and the found rule starts with the search rule or equals it // (without the trailing dash). if ( - !$searchPattern || $propertyName === $searchPattern + $searchPattern === null || $propertyName === $searchPattern || (\strrpos($searchPattern, '-') === \strlen($searchPattern) - \strlen('-') && (\strpos($propertyName, $searchPattern) === 0 || $propertyName === \substr($searchPattern, 0, -1)))