@@ -103,15 +103,15 @@ public function getLineNo(): int
103
103
104
104
public function addRule (Rule $ ruleToAdd , ?Rule $ sibling = null ): void
105
105
{
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 ] = [];
109
109
}
110
110
111
- $ position = \count ($ this ->rules [$ rule ]);
111
+ $ position = \count ($ this ->rules [$ propertyName ]);
112
112
113
113
if ($ sibling !== null ) {
114
- $ siblingPosition = \array_search ($ sibling , $ this ->rules [$ rule ], true );
114
+ $ siblingPosition = \array_search ($ sibling , $ this ->rules [$ propertyName ], true );
115
115
if ($ siblingPosition !== false ) {
116
116
$ position = $ siblingPosition ;
117
117
$ ruleToAdd ->setPosition ($ sibling ->getLineNo (), $ sibling ->getColNo () - 1 );
@@ -127,7 +127,7 @@ public function addRule(Rule $ruleToAdd, ?Rule $sibling = null): void
127
127
}
128
128
}
129
129
130
- \array_splice ($ this ->rules [$ rule ], $ position , 0 , [$ ruleToAdd ]);
130
+ \array_splice ($ this ->rules [$ propertyName ], $ position , 0 , [$ ruleToAdd ]);
131
131
}
132
132
133
133
/**
0 commit comments