Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ parameters:
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.$#'
identifier: ternary.shortNotAllowed
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Parameters should have "string\|null" types as the only types passed to this method$#'
identifier: typePerfect.narrowPublicClassMethodParamType
Expand Down
7 changes: 5 additions & 2 deletions src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,11 @@ private static function parseAtRule(ParserState $parserState): ?CSSListItem
*/
private static function identifierIs(string $identifier, string $match): bool
{
return (\strcasecmp($identifier, $match) === 0)
?: \preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1;
if (\strcasecmp($identifier, $match) === 0) {
return true;
}

return \preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1;
}

/**
Expand Down