Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Please also have a look at our
- `Rule\Rule` class is deprecated; `Property\Declaration` is a direct
replacement (#1508)
- `Rule::setRule()` and `getRule()` are deprecated and replaced with
`setPropertyName()` and `getPropertyName()` (#1506)
`setPropertyName()` and `getPropertyName()` (#1506, #1519)

### Removed

Expand Down
6 changes: 3 additions & 3 deletions src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function parseRuleSet(ParserState $parserState, RuleSet $ruleSet):
*/
public function addRule(Declaration $declarationToAdd, ?Declaration $sibling = null): void
{
$propertyName = $declarationToAdd->getRule();
$propertyName = $declarationToAdd->getPropertyName();
if (!isset($this->declarations[$propertyName])) {
$this->declarations[$propertyName] = [];
}
Expand Down Expand Up @@ -240,7 +240,7 @@ public function getRulesAssoc(?string $searchPattern = null): array
/** @var array<string, Declaration> $result */
$result = [];
foreach ($this->getRules($searchPattern) as $declaration) {
$result[$declaration->getRule()] = $declaration;
$result[$declaration->getPropertyName()] = $declaration;
}

return $result;
Expand All @@ -251,7 +251,7 @@ public function getRulesAssoc(?string $searchPattern = null): array
*/
public function removeRule(Declaration $declarationToRemove): void
{
$nameOfPropertyToRemove = $declarationToRemove->getRule();
$nameOfPropertyToRemove = $declarationToRemove->getPropertyName();
if (!isset($this->declarations[$nameOfPropertyToRemove])) {
return;
}
Expand Down