Skip to content

Commit ee15f8f

Browse files
authored
[CLEANUP] Improve a parameter name in RuleSet::addRule() (#1034)
1 parent e6ce845 commit ee15f8f

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
@@ -101,9 +101,9 @@ public function getLineNo(): int
101101
return $this->lineNumber;
102102
}
103103

104-
public function addRule(Rule $rule, ?Rule $sibling = null): void
104+
public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
105105
{
106-
$sRule = $rule->getRule();
106+
$sRule = $ruleToAdd->getRule();
107107
if (!isset($this->rules[$sRule])) {
108108
$this->rules[$sRule] = [];
109109
}
@@ -114,20 +114,20 @@ public function addRule(Rule $rule, ?Rule $sibling = null): void
114114
$iSiblingPos = \array_search($sibling, $this->rules[$sRule], true);
115115
if ($iSiblingPos !== false) {
116116
$position = $iSiblingPos;
117-
$rule->setPosition($sibling->getLineNo(), $sibling->getColNo() - 1);
117+
$ruleToAdd->setPosition($sibling->getLineNo(), $sibling->getColNo() - 1);
118118
}
119119
}
120-
if ($rule->getLineNo() === 0 && $rule->getColNo() === 0) {
120+
if ($ruleToAdd->getLineNo() === 0 && $ruleToAdd->getColNo() === 0) {
121121
//this node is added manually, give it the next best line
122122
$rules = $this->getRules();
123123
$pos = \count($rules);
124124
if ($pos > 0) {
125125
$last = $rules[$pos - 1];
126-
$rule->setPosition($last->getLineNo() + 1, 0);
126+
$ruleToAdd->setPosition($last->getLineNo() + 1, 0);
127127
}
128128
}
129129

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

133133
/**

0 commit comments

Comments
 (0)