Skip to content

Commit 4a7d4cd

Browse files
committed
Changes suggested in code review
1 parent 6c2887e commit 4a7d4cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/RuleSet/RuleSet.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ public function getLineNo(): int
103103

104104
public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
105105
{
106-
$rule = $ruleToAdd->getRule();
107-
if (!isset($this->rules[$rule])) {
108-
$this->rules[$rule] = [];
106+
$propertyName = $ruleToAdd->getRule();
107+
if (!isset($this->rules[$propertyName])) {
108+
$this->rules[$propertyName] = [];
109109
}
110110

111-
$position = \count($this->rules[$rule]);
111+
$position = \count($this->rules[$propertyName]);
112112

113113
if ($sibling !== null) {
114-
$siblingPosition = \array_search($sibling, $this->rules[$rule], true);
114+
$siblingPosition = \array_search($sibling, $this->rules[$propertyName], true);
115115
if ($siblingPosition !== false) {
116116
$position = $siblingPosition;
117117
$ruleToAdd->setPosition($sibling->getLineNo(), $sibling->getColNo() - 1);
@@ -127,7 +127,7 @@ public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
127127
}
128128
}
129129

130-
\array_splice($this->rules[$rule], $position, 0, [$ruleToAdd]);
130+
\array_splice($this->rules[$propertyName], $position, 0, [$ruleToAdd]);
131131
}
132132

133133
/**

0 commit comments

Comments
 (0)