From 5932c1aff688f48b8c22cc3019be2a721cbe93ea Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Tue, 18 Jun 2024 11:13:46 +0200 Subject: [PATCH 1/2] [CLEANUP] Final removal of Rule::setValues Signed-off-by: Daniel Ziegenberg --- CHANGELOG.md | 1 + src/Rule/Rule.php | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ba5f8d..c89c5c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Remove `DeclarationBlock::setSelector()` (#560) - Drop support for PHP < 7.2 (#420) +- Final removal of `Rule::setValues()` (#562) ### Fixed diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index 2c56f7de..aecb6bf8 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -189,48 +189,6 @@ public function setValue($mValue) $this->mValue = $mValue; } - /** - * @param array> $aSpaceSeparatedValues - * - * @return RuleValueList - * - * @deprecated will be removed in version 9.0 - * Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility. - * Use `setValue()` instead and wrap the value inside a RuleValueList if necessary. - */ - public function setValues(array $aSpaceSeparatedValues) - { - $oSpaceSeparatedList = null; - if (count($aSpaceSeparatedValues) > 1) { - $oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo); - } - foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) { - $oCommaSeparatedList = null; - if (count($aCommaSeparatedValues) > 1) { - $oCommaSeparatedList = new RuleValueList(',', $this->iLineNo); - } - foreach ($aCommaSeparatedValues as $mValue) { - if (!$oSpaceSeparatedList && !$oCommaSeparatedList) { - $this->mValue = $mValue; - return $mValue; - } - if ($oCommaSeparatedList) { - $oCommaSeparatedList->addListComponent($mValue); - } else { - $oSpaceSeparatedList->addListComponent($mValue); - } - } - if (!$oSpaceSeparatedList) { - $this->mValue = $oCommaSeparatedList; - return $oCommaSeparatedList; - } else { - $oSpaceSeparatedList->addListComponent($oCommaSeparatedList); - } - } - $this->mValue = $oSpaceSeparatedList; - return $oSpaceSeparatedList; - } - /** * @return array> * From 314562544b498feb3070d7ad7ebe0a80a0d6214d Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Tue, 18 Jun 2024 17:12:33 +0200 Subject: [PATCH 2/2] fixup! [CLEANUP] Final removal of Rule::setValues --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c89c5c02..04dbf270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,9 +22,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Removed +- Remove `Rule::setValues()` (#562) - Remove `DeclarationBlock::setSelector()` (#560) - Drop support for PHP < 7.2 (#420) -- Final removal of `Rule::setValues()` (#562) ### Fixed