Skip to content

Commit 5d5aeac

Browse files
committed
[CLEANUP] Avoid use of short-ternary operator
(I share a birthday with Elvis, but needs must.)
1 parent e57a7ba commit 5d5aeac

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ parameters:
1818
count: 1
1919
path: ../src/CSSList/CSSList.php
2020

21-
-
22-
message: '#^Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.$#'
23-
identifier: ternary.shortNotAllowed
24-
count: 1
25-
path: ../src/CSSList/CSSList.php
26-
2721
-
2822
message: '#^Parameters should have "string\|null" types as the only types passed to this method$#'
2923
identifier: typePerfect.narrowPublicClassMethodParamType

src/CSSList/CSSList.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ private static function parseAtRule(ParserState $parserState): ?CSSListItem
243243
private static function identifierIs(string $identifier, string $match): bool
244244
{
245245
return (\strcasecmp($identifier, $match) === 0)
246-
?: \preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1;
246+
? \preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1
247+
: false;
247248
}
248249

249250
/**

0 commit comments

Comments
 (0)