Skip to content

Commit c9d37e7

Browse files
authored
[TASK] Remove __toString() (#1046)
Closes #998
1 parent f9609c4 commit c9d37e7

24 files changed

+1
-211
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Please also have a look at our
4848

4949
### Removed
5050

51+
- Remove `__toString()` (#1046)
5152
- Drop magic method forwarding in `OutputFormat` (#898)
5253
- Drop `atRuleArgs()` from the `AtRule` interface (#1141)
5354
- Remove `OutputFormat::get()` and `::set()` (#1108, #1110)

src/CSSList/AtRuleBlockList.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ public function atRuleArgs(): string
4646
return $this->arguments;
4747
}
4848

49-
/**
50-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
51-
*/
52-
public function __toString(): string
53-
{
54-
return $this->render(new OutputFormat());
55-
}
56-
5749
public function render(OutputFormat $outputFormat): string
5850
{
5951
$formatter = $outputFormat->getFormatter();

src/CSSList/CSSList.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,6 @@ public function removeDeclarationBlockBySelector($selectors, $removeAll = false)
400400
}
401401
}
402402

403-
/**
404-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
405-
*/
406-
public function __toString(): string
407-
{
408-
return $this->render(new OutputFormat());
409-
}
410-
411403
protected function renderListContents(OutputFormat $outputFormat): string
412404
{
413405
$result = '';

src/CSSList/KeyFrame.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ public function getAnimationName(): string
5151
return $this->animationName;
5252
}
5353

54-
/**
55-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
56-
*/
57-
public function __toString(): string
58-
{
59-
return $this->render(new OutputFormat());
60-
}
61-
6254
public function render(OutputFormat $outputFormat): string
6355
{
6456
$formatter = $outputFormat->getFormatter();

src/Comment/Comment.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ public function setComment(string $commentText): void
5050
$this->commentText = $commentText;
5151
}
5252

53-
/**
54-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
55-
*/
56-
public function __toString(): string
57-
{
58-
return $this->render(new OutputFormat());
59-
}
60-
6153
public function render(OutputFormat $outputFormat): string
6254
{
6355
return '/*' . $this->commentText . '*/';

src/Property/CSSNamespace.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ public function getLineNo(): int
5454
return $this->lineNumber;
5555
}
5656

57-
/**
58-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
59-
*/
60-
public function __toString(): string
61-
{
62-
return $this->render(new OutputFormat());
63-
}
64-
6557
public function render(OutputFormat $outputFormat): string
6658
{
6759
return '@namespace ' . ($this->prefix === null ? '' : $this->prefix . ' ')

src/Property/Charset.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ public function getCharset(): string
6868
return $this->charset->getString();
6969
}
7070

71-
/**
72-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
73-
*/
74-
public function __toString(): string
75-
{
76-
return $this->render(new OutputFormat());
77-
}
78-
7971
public function render(OutputFormat $outputFormat): string
8072
{
8173
return "{$outputFormat->getFormatter()->comments($this)}@charset {$this->charset->render($outputFormat)};";

src/Property/Import.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ public function getLocation(): URL
6565
return $this->location;
6666
}
6767

68-
/**
69-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
70-
*/
71-
public function __toString(): string
72-
{
73-
return $this->render(new OutputFormat());
74-
}
75-
7668
public function render(OutputFormat $outputFormat): string
7769
{
7870
return $outputFormat->getFormatter()->comments($this) . '@import ' . $this->location->render($outputFormat)

src/Property/Selector.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ public function setSelector(string $selector): void
6262
$this->selector = \trim($selector);
6363
}
6464

65-
/**
66-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
67-
*/
68-
public function __toString(): string
69-
{
70-
return $this->getSelector();
71-
}
72-
7365
/**
7466
* @return int<0, max>
7567
*/

src/Renderable.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@
66

77
interface Renderable
88
{
9-
/**
10-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
11-
*/
12-
public function __toString(): string;
13-
149
public function render(OutputFormat $outputFormat): string;
1510
}

src/Rule/Rule.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,6 @@ public function getIsImportant()
224224
return $this->isImportant;
225225
}
226226

227-
/**
228-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
229-
*/
230-
public function __toString(): string
231-
{
232-
return $this->render(new OutputFormat());
233-
}
234-
235227
public function render(OutputFormat $outputFormat): string
236228
{
237229
$formatter = $outputFormat->getFormatter();

src/RuleSet/AtRuleSet.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ public function atRuleArgs()
5353
return $this->arguments;
5454
}
5555

56-
/**
57-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
58-
*/
59-
public function __toString(): string
60-
{
61-
return $this->render(new OutputFormat());
62-
}
63-
6456
public function render(OutputFormat $outputFormat): string
6557
{
6658
$formatter = $outputFormat->getFormatter();

src/RuleSet/DeclarationBlock.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,6 @@ public function getSelectors()
140140
return $this->selectors;
141141
}
142142

143-
/**
144-
* @throws OutputException
145-
*
146-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
147-
*/
148-
public function __toString(): string
149-
{
150-
return $this->render(new OutputFormat());
151-
}
152-
153143
/**
154144
* @throws OutputException
155145
*/

src/RuleSet/RuleSet.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,6 @@ public function removeRule($searchPattern): void
265265
}
266266
}
267267

268-
/**
269-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
270-
*/
271-
public function __toString(): string
272-
{
273-
return $this->render(new OutputFormat());
274-
}
275-
276268
protected function renderRules(OutputFormat $outputFormat): string
277269
{
278270
$result = '';

src/Value/CSSFunction.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,6 @@ public function getArguments()
105105
return $this->components;
106106
}
107107

108-
/**
109-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
110-
*/
111-
public function __toString(): string
112-
{
113-
return $this->render(new OutputFormat());
114-
}
115-
116108
public function render(OutputFormat $outputFormat): string
117109
{
118110
$arguments = parent::render($outputFormat);

src/Value/CSSString.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ public function getString(): string
8383
return $this->string;
8484
}
8585

86-
/**
87-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
88-
*/
89-
public function __toString(): string
90-
{
91-
return $this->render(new OutputFormat());
92-
}
93-
9486
public function render(OutputFormat $outputFormat): string
9587
{
9688
$string = \addslashes($this->string);

src/Value/Color.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,6 @@ public function getColorDescription()
224224
return $this->getName();
225225
}
226226

227-
/**
228-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
229-
*/
230-
public function __toString(): string
231-
{
232-
return $this->render(new OutputFormat());
233-
}
234-
235227
public function render(OutputFormat $outputFormat): string
236228
{
237229
if ($this->shouldRenderAsHex($outputFormat)) {

src/Value/LineName.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ public static function parse(ParserState $parserState): LineName
4949
return new LineName($names, $parserState->currentLine());
5050
}
5151

52-
/**
53-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
54-
*/
55-
public function __toString(): string
56-
{
57-
return $this->render(new OutputFormat());
58-
}
59-
6052
public function render(OutputFormat $outputFormat): string
6153
{
6254
return '[' . parent::render(OutputFormat::createCompact()) . ']';

src/Value/Size.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,6 @@ public function isRelative(): bool
195195
return false;
196196
}
197197

198-
/**
199-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
200-
*/
201-
public function __toString(): string
202-
{
203-
return $this->render(new OutputFormat());
204-
}
205-
206198
public function render(OutputFormat $outputFormat): string
207199
{
208200
$locale = \localeconv();

src/Value/URL.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ public function getURL(): CSSString
7373
return $this->url;
7474
}
7575

76-
/**
77-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
78-
*/
79-
public function __toString(): string
80-
{
81-
return $this->render(new OutputFormat());
82-
}
83-
8476
public function render(OutputFormat $outputFormat): string
8577
{
8678
return "url({$this->url->render($outputFormat)})";

src/Value/ValueList.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ public function setListSeparator($separator): void
8383
$this->separator = $separator;
8484
}
8585

86-
/**
87-
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
88-
*/
89-
public function __toString(): string
90-
{
91-
return $this->render(new OutputFormat());
92-
}
93-
9486
public function render(OutputFormat $outputFormat): string
9587
{
9688
$formatter = $outputFormat->getFormatter();

tests/FunctionalDeprecated/.gitkeep

Whitespace-only changes.

tests/FunctionalDeprecated/Comment/CommentTest.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/FunctionalDeprecated/Property/SelectorTest.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)