Skip to content

Commit 06814c5

Browse files
committed
[CLEANUP] Final removal of Rule::getValues
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
1 parent 55e7f21 commit 06814c5

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

CHANGELOG.md

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

2323
- Drop support for PHP < 7.2 (#420)
24+
- Final removal of `Rule::getValues()` (#563)
2425

2526
### Fixed
2627

src/Rule/Rule.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -231,37 +231,6 @@ public function setValues(array $aSpaceSeparatedValues)
231231
return $oSpaceSeparatedList;
232232
}
233233

234-
/**
235-
* @return array<int, array<int, RuleValueList>>
236-
*
237-
* @deprecated will be removed in version 9.0
238-
* Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility.
239-
* Use `getValue()` instead and check for the existence of a (nested set of) ValueList object(s).
240-
*/
241-
public function getValues(): array
242-
{
243-
if (!$this->mValue instanceof RuleValueList) {
244-
return [[$this->mValue]];
245-
}
246-
if ($this->mValue->getListSeparator() === ',') {
247-
return [$this->mValue->getListComponents()];
248-
}
249-
$aResult = [];
250-
foreach ($this->mValue->getListComponents() as $mValue) {
251-
if (!$mValue instanceof RuleValueList || $mValue->getListSeparator() !== ',') {
252-
$aResult[] = [$mValue];
253-
continue;
254-
}
255-
if ($this->mValue->getListSeparator() === ' ' || count($aResult) === 0) {
256-
$aResult[] = [];
257-
}
258-
foreach ($mValue->getListComponents() as $mValue) {
259-
$aResult[count($aResult) - 1][] = $mValue;
260-
}
261-
}
262-
return $aResult;
263-
}
264-
265234
/**
266235
* Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
267236
* Otherwise, the existing value will be wrapped by one.

0 commit comments

Comments
 (0)