Skip to content

Commit 13a459c

Browse files
committed
[CLEANUP] Final removal of deprecated functions (#557)
Final removal - Document::getAllSelectors - Rule::setValues - Rule::getValues - DeclarationBlock::setSelector - DeclarationBlock::getSelector Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
1 parent b3b3a51 commit 13a459c

File tree

4 files changed

+5
-108
lines changed

4 files changed

+5
-108
lines changed

CHANGELOG.md

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

2323
- Drop support for PHP < 7.2 (#420)
24+
- Final removal of Document::getAllSelectors (#557)
25+
- Final removal of Rule::setValues (#557)
26+
- Final removal of Rule::getValues (#557)
27+
- Final removal of DeclarationBlock::setSelector (#557)
28+
- Final removal of DeclarationBlock::getSelector (#557)
2429

2530
### Fixed
2631

src/CSSList/Document.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,6 @@ public function getAllDeclarationBlocks()
5050
return $aResult;
5151
}
5252

53-
/**
54-
* Gets all `DeclarationBlock` objects recursively.
55-
*
56-
* @return array<int, DeclarationBlock>
57-
*
58-
* @deprecated will be removed in version 9.0; use `getAllDeclarationBlocks()` instead
59-
*/
60-
public function getAllSelectors()
61-
{
62-
return $this->getAllDeclarationBlocks();
63-
}
64-
6553
/**
6654
* Returns all `RuleSet` objects recursively found in the tree, no matter how deeply nested the rule sets are.
6755
*

src/Rule/Rule.php

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

192-
/**
193-
* @param array<array-key, array<array-key, RuleValueList>> $aSpaceSeparatedValues
194-
*
195-
* @return RuleValueList
196-
*
197-
* @deprecated will be removed in version 9.0
198-
* Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility.
199-
* Use `setValue()` instead and wrap the value inside a RuleValueList if necessary.
200-
*/
201-
public function setValues(array $aSpaceSeparatedValues)
202-
{
203-
$oSpaceSeparatedList = null;
204-
if (count($aSpaceSeparatedValues) > 1) {
205-
$oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo);
206-
}
207-
foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) {
208-
$oCommaSeparatedList = null;
209-
if (count($aCommaSeparatedValues) > 1) {
210-
$oCommaSeparatedList = new RuleValueList(',', $this->iLineNo);
211-
}
212-
foreach ($aCommaSeparatedValues as $mValue) {
213-
if (!$oSpaceSeparatedList && !$oCommaSeparatedList) {
214-
$this->mValue = $mValue;
215-
return $mValue;
216-
}
217-
if ($oCommaSeparatedList) {
218-
$oCommaSeparatedList->addListComponent($mValue);
219-
} else {
220-
$oSpaceSeparatedList->addListComponent($mValue);
221-
}
222-
}
223-
if (!$oSpaceSeparatedList) {
224-
$this->mValue = $oCommaSeparatedList;
225-
return $oCommaSeparatedList;
226-
} else {
227-
$oSpaceSeparatedList->addListComponent($oCommaSeparatedList);
228-
}
229-
}
230-
$this->mValue = $oSpaceSeparatedList;
231-
return $oSpaceSeparatedList;
232-
}
233-
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-
265192
/**
266193
* Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
267194
* Otherwise, the existing value will be wrapped by one.

src/RuleSet/DeclarationBlock.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -146,29 +146,6 @@ public function removeSelector($mSelector)
146146
return false;
147147
}
148148

149-
/**
150-
* @return array<int, Selector|string>
151-
*
152-
* @deprecated will be removed in version 9.0; use `getSelectors()` instead
153-
*/
154-
public function getSelector()
155-
{
156-
return $this->getSelectors();
157-
}
158-
159-
/**
160-
* @param Selector|string $mSelector
161-
* @param CSSList|null $oList
162-
*
163-
* @return void
164-
*
165-
* @deprecated will be removed in version 9.0; use `setSelectors()` instead
166-
*/
167-
public function setSelector($mSelector, $oList = null)
168-
{
169-
$this->setSelectors($mSelector, $oList);
170-
}
171-
172149
/**
173150
* @return array<int, Selector|string>
174151
*/

0 commit comments

Comments
 (0)