diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 7cc38e69..6205096a 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -84,12 +84,6 @@ parameters: count: 1 path: ../tests/ParserTest.php - - - message: '#^Parameter \#1 \$message of static method PHPUnit\\Framework\\Assert\:\:fail\(\) expects string, Exception given\.$#' - identifier: argument.type - count: 1 - path: ../tests/ParserTest.php - - message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#' identifier: argument.type diff --git a/src/Property/Selector.php b/src/Property/Selector.php index df8d0e90..a647378e 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -8,6 +8,8 @@ use Sabberworm\CSS\Property\Selector\SpecificityCalculator; use Sabberworm\CSS\Renderable; +use function Safe\preg_match; + /** * Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this * class. @@ -57,7 +59,7 @@ class Selector implements Renderable public static function isValid(string $selector): bool { // Note: We need to use `static::` here as the constant is overridden in the `KeyframeSelector` class. - $numberOfMatches = \preg_match(static::SELECTOR_VALIDATION_RX, $selector); + $numberOfMatches = preg_match(static::SELECTOR_VALIDATION_RX, $selector); return $numberOfMatches === 1; } diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 0217eba9..f6425a0b 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -73,11 +73,7 @@ public function files(): void continue; } $parser = new Parser(\file_get_contents($directory . '/' . $filename)); - try { - self::assertNotEquals('', $parser->parse()->render()); - } catch (\Exception $e) { - self::fail($e); - } + self::assertNotSame('', $parser->parse()->render()); } \closedir($directoryHandle); }