Skip to content

Commit 73ea52c

Browse files
committed
Only booleans are allowed in an if condition
1 parent e4e17b9 commit 73ea52c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Rules/PlaceholderCharactersRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public function processNode(Node $node, Scope $scope): array
8686
$message = $constantStringType->getValue();
8787

8888
$doubleBraceError = self::checkDoubleBrace($message, $methodName);
89-
if ($doubleBraceError) {
89+
if ($doubleBraceError instanceof RuleError) {
9090
$errors[] = $doubleBraceError;
9191
continue;
9292
}
9393

9494
$invalidCharError = self::checkInvalidChar($message, $methodName);
95-
if ($invalidCharError) {
95+
if ($invalidCharError instanceof RuleError) {
9696
$errors[] = $invalidCharError;
9797
}
9898
}

src/Rules/PlaceholderCorrespondToKeysRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function processNode(Node $node, Scope $scope): array
9999
$context = $args[$contextArgumentNo];
100100

101101
$doesNohHaveError = self::contextDoesNotHavePlaceholderKey($scope->getType($context->value), $methodName, $matches[0], $matches[1]);
102-
if ($doesNohHaveError) {
102+
if ($doesNohHaveError instanceof RuleError) {
103103
$errors[] = $doesNohHaveError;
104104
}
105105
}

0 commit comments

Comments
 (0)