Skip to content

Commit f462377

Browse files
committed
Remove duplicate empty checks
1 parent ab70ce5 commit f462377

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Rules/PlaceholderCorrespondToKeysRule.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public function processNode(Node $node, Scope $scope): array
9898

9999
$context = $args[$contextArgumentNo];
100100

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

@@ -121,12 +121,6 @@ private static function contextDoesNotHavePlaceholderKey(Type $arrayType, string
121121

122122
$constantArrays = $arrayType->getConstantArrays();
123123

124-
if (count($constantArrays) === 0) {
125-
return RuleErrorBuilder::message(
126-
self::ERROR_EMPTY_CONTEXT
127-
)->identifier('sfp-psr-log.placeholderCorrespondToKeysMissedKey')->build();
128-
}
129-
130124
foreach ($constantArrays as $constantArray) {
131125
$contextKeys = [];
132126
$checkBraces = $braces;

0 commit comments

Comments
 (0)