Skip to content

Commit f76adec

Browse files
committed
[TASK] Use strict equality
One instance is left out, but is covered by #1330.
1 parent b6b8ecf commit f76adec

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/CSSList/CSSList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private static function parseAtRule(ParserState $parserState): ?CSSListItem
208208
} else {
209209
// Unknown other at rule (font-face or such)
210210
$arguments = \trim($parserState->consumeUntil('{', false, true));
211-
if (\substr_count($arguments, '(') != \substr_count($arguments, ')')) {
211+
if (\substr_count($arguments, '(') !== \substr_count($arguments, ')')) {
212212
if ($parserState->getSettings()->usesLenientParsing()) {
213213
return null;
214214
} else {

src/Value/CalcFunction.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false)
3030
{
3131
$operators = ['+', '-', '*', '/'];
3232
$function = $parserState->parseIdentifier();
33-
if ($parserState->peek() != '(') {
33+
if ($parserState->peek() !== '(') {
3434
// Found ; or end of line before an opening bracket
3535
throw new UnexpectedTokenException('(', $parserState->peek(), 'literal', $parserState->currentLine());
3636
} elseif ($function !== 'calc') {
@@ -59,15 +59,15 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false)
5959
$parserState->consumeWhiteSpace();
6060
continue;
6161
}
62-
if ($lastComponentType != CalcFunction::T_OPERAND) {
62+
if ($lastComponentType !== CalcFunction::T_OPERAND) {
6363
$value = Value::parsePrimitiveValue($parserState);
6464
$calcRuleValueList->addListComponent($value);
6565
$lastComponentType = CalcFunction::T_OPERAND;
6666
} else {
6767
if (\in_array($parserState->peek(), $operators, true)) {
6868
if (($parserState->comes('-') || $parserState->comes('+'))) {
6969
if (
70-
$parserState->peek(1, -1) != ' '
70+
$parserState->peek(1, -1) !== ' '
7171
|| !($parserState->comes('- ')
7272
|| $parserState->comes('+ '))
7373
) {

src/Value/Color.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private function renderAsHex(): string
289289
$this->components['g']->getSize(),
290290
$this->components['b']->getSize()
291291
);
292-
$canUseShortVariant = ($result[0] == $result[1]) && ($result[2] == $result[3]) && ($result[4] == $result[5]);
292+
$canUseShortVariant = ($result[0] === $result[1]) && ($result[2] === $result[3]) && ($result[4] === $result[5]);
293293

294294
return '#' . ($canUseShortVariant ? $result[0] . $result[2] . $result[4] : $result);
295295
}

src/Value/Size.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function isRelative(): bool
189189
if (\in_array($this->unit, self::RELATIVE_SIZE_UNITS, true)) {
190190
return true;
191191
}
192-
if ($this->unit === null && $this->size != 0) {
192+
if ($this->unit === null && $this->size !== 0.0) {
193193
return true;
194194
}
195195
return false;

0 commit comments

Comments
 (0)