Skip to content

Commit c415003

Browse files
authored
[TASK] Remove Rule::getValues (#582)
1 parent 8a6c5c7 commit c415003

File tree

3 files changed

+2
-33
lines changed

3 files changed

+2
-33
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2222

2323
### Removed
2424

25+
- Remove `Rule::getValues()` (#582)
2526
- Remove `Rule::setValues()` (#562)
2627
- Remove `Document::getAllSelectors()` (#561)
2728
- Remove `DeclarationBlock::getSelector()` (#559)

src/Rule/Rule.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -189,37 +189,6 @@ public function setValue($mValue)
189189
$this->mValue = $mValue;
190190
}
191191

192-
/**
193-
* @return array<int, array<int, RuleValueList>>
194-
*
195-
* @deprecated will be removed in version 9.0
196-
* Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility.
197-
* Use `getValue()` instead and check for the existence of a (nested set of) ValueList object(s).
198-
*/
199-
public function getValues(): array
200-
{
201-
if (!$this->mValue instanceof RuleValueList) {
202-
return [[$this->mValue]];
203-
}
204-
if ($this->mValue->getListSeparator() === ',') {
205-
return [$this->mValue->getListComponents()];
206-
}
207-
$aResult = [];
208-
foreach ($this->mValue->getListComponents() as $mValue) {
209-
if (!$mValue instanceof RuleValueList || $mValue->getListSeparator() !== ',') {
210-
$aResult[] = [$mValue];
211-
continue;
212-
}
213-
if ($this->mValue->getListSeparator() === ' ' || count($aResult) === 0) {
214-
$aResult[] = [];
215-
}
216-
foreach ($mValue->getListComponents() as $mValue) {
217-
$aResult[count($aResult) - 1][] = $mValue;
218-
}
219-
}
220-
return $aResult;
221-
}
222-
223192
/**
224193
* Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
225194
* Otherwise, the existing value will be wrapped by one.

tests/ParserTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ public function unicodeParsing(): void
182182
continue;
183183
}
184184
$aContentRules = $oRuleSet->getRules('content');
185-
$aContents = $aContentRules[0]->getValues();
186-
$sString = $aContents[0][0]->__toString();
185+
$sString = $aContentRules[0]->getValue()->__toString();
187186
if ($sSelector == '.test-1') {
188187
self::assertSame('" "', $sString);
189188
}

0 commit comments

Comments
 (0)