diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1ec091..0c999e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Please also have a look at our ### Removed +- Remove `__toString()` (#1046) - Drop magic method forwarding in `OutputFormat` (#898) - Drop `atRuleArgs()` from the `AtRule` interface (#1141) - Remove `OutputFormat::get()` and `::set()` (#1108, #1110) diff --git a/src/CSSList/AtRuleBlockList.php b/src/CSSList/AtRuleBlockList.php index 5d17ee86..57c04ab8 100644 --- a/src/CSSList/AtRuleBlockList.php +++ b/src/CSSList/AtRuleBlockList.php @@ -46,14 +46,6 @@ public function atRuleArgs(): string return $this->arguments; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $formatter = $outputFormat->getFormatter(); diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index c4d98f72..67277b44 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -400,14 +400,6 @@ public function removeDeclarationBlockBySelector($selectors, $removeAll = false) } } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - protected function renderListContents(OutputFormat $outputFormat): string { $result = ''; diff --git a/src/CSSList/KeyFrame.php b/src/CSSList/KeyFrame.php index 12d79804..f1f96cec 100644 --- a/src/CSSList/KeyFrame.php +++ b/src/CSSList/KeyFrame.php @@ -51,14 +51,6 @@ public function getAnimationName(): string return $this->animationName; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $formatter = $outputFormat->getFormatter(); diff --git a/src/Comment/Comment.php b/src/Comment/Comment.php index 761d6d82..e96bd28e 100644 --- a/src/Comment/Comment.php +++ b/src/Comment/Comment.php @@ -50,14 +50,6 @@ public function setComment(string $commentText): void $this->commentText = $commentText; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return '/*' . $this->commentText . '*/'; diff --git a/src/Property/CSSNamespace.php b/src/Property/CSSNamespace.php index 78989d8a..75336249 100644 --- a/src/Property/CSSNamespace.php +++ b/src/Property/CSSNamespace.php @@ -54,14 +54,6 @@ public function getLineNo(): int return $this->lineNumber; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return '@namespace ' . ($this->prefix === null ? '' : $this->prefix . ' ') diff --git a/src/Property/Charset.php b/src/Property/Charset.php index dd9dfad8..14cb9321 100644 --- a/src/Property/Charset.php +++ b/src/Property/Charset.php @@ -68,14 +68,6 @@ public function getCharset(): string return $this->charset->getString(); } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return "{$outputFormat->getFormatter()->comments($this)}@charset {$this->charset->render($outputFormat)};"; diff --git a/src/Property/Import.php b/src/Property/Import.php index dfa11ae5..f889786b 100644 --- a/src/Property/Import.php +++ b/src/Property/Import.php @@ -65,14 +65,6 @@ public function getLocation(): URL return $this->location; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return $outputFormat->getFormatter()->comments($this) . '@import ' . $this->location->render($outputFormat) diff --git a/src/Property/Selector.php b/src/Property/Selector.php index f8008e44..180ffeba 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -62,14 +62,6 @@ public function setSelector(string $selector): void $this->selector = \trim($selector); } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->getSelector(); - } - /** * @return int<0, max> */ diff --git a/src/Renderable.php b/src/Renderable.php index ed633654..9ebf9a9b 100644 --- a/src/Renderable.php +++ b/src/Renderable.php @@ -6,10 +6,5 @@ interface Renderable { - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string; - public function render(OutputFormat $outputFormat): string; } diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index a20e864d..b84f0996 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -224,14 +224,6 @@ public function getIsImportant() return $this->isImportant; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $formatter = $outputFormat->getFormatter(); diff --git a/src/RuleSet/AtRuleSet.php b/src/RuleSet/AtRuleSet.php index a896246b..1e28aa54 100644 --- a/src/RuleSet/AtRuleSet.php +++ b/src/RuleSet/AtRuleSet.php @@ -53,14 +53,6 @@ public function atRuleArgs() return $this->arguments; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $formatter = $outputFormat->getFormatter(); diff --git a/src/RuleSet/DeclarationBlock.php b/src/RuleSet/DeclarationBlock.php index 29516764..7763f00e 100644 --- a/src/RuleSet/DeclarationBlock.php +++ b/src/RuleSet/DeclarationBlock.php @@ -140,16 +140,6 @@ public function getSelectors() return $this->selectors; } - /** - * @throws OutputException - * - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - /** * @throws OutputException */ diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 2c57116f..622f9f16 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -265,14 +265,6 @@ public function removeRule($searchPattern): void } } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - protected function renderRules(OutputFormat $outputFormat): string { $result = ''; diff --git a/src/Value/CSSFunction.php b/src/Value/CSSFunction.php index 3c10900e..5941b4b3 100644 --- a/src/Value/CSSFunction.php +++ b/src/Value/CSSFunction.php @@ -105,14 +105,6 @@ public function getArguments() return $this->components; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $arguments = parent::render($outputFormat); diff --git a/src/Value/CSSString.php b/src/Value/CSSString.php index 7f352502..a71175ef 100644 --- a/src/Value/CSSString.php +++ b/src/Value/CSSString.php @@ -83,14 +83,6 @@ public function getString(): string return $this->string; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $string = \addslashes($this->string); diff --git a/src/Value/Color.php b/src/Value/Color.php index 3f5adbc9..f6eeaa60 100644 --- a/src/Value/Color.php +++ b/src/Value/Color.php @@ -224,14 +224,6 @@ public function getColorDescription() return $this->getName(); } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { if ($this->shouldRenderAsHex($outputFormat)) { diff --git a/src/Value/LineName.php b/src/Value/LineName.php index aad8b6bd..9afe6703 100644 --- a/src/Value/LineName.php +++ b/src/Value/LineName.php @@ -49,14 +49,6 @@ public static function parse(ParserState $parserState): LineName return new LineName($names, $parserState->currentLine()); } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return '[' . parent::render(OutputFormat::createCompact()) . ']'; diff --git a/src/Value/Size.php b/src/Value/Size.php index bbf91eb5..e3cf6b89 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -195,14 +195,6 @@ public function isRelative(): bool return false; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $locale = \localeconv(); diff --git a/src/Value/URL.php b/src/Value/URL.php index f9bc9e8a..f1fe258b 100644 --- a/src/Value/URL.php +++ b/src/Value/URL.php @@ -73,14 +73,6 @@ public function getURL(): CSSString return $this->url; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { return "url({$this->url->render($outputFormat)})"; diff --git a/src/Value/ValueList.php b/src/Value/ValueList.php index 8a50809d..3e57d7fe 100644 --- a/src/Value/ValueList.php +++ b/src/Value/ValueList.php @@ -83,14 +83,6 @@ public function setListSeparator($separator): void $this->separator = $separator; } - /** - * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead. - */ - public function __toString(): string - { - return $this->render(new OutputFormat()); - } - public function render(OutputFormat $outputFormat): string { $formatter = $outputFormat->getFormatter(); diff --git a/tests/FunctionalDeprecated/.gitkeep b/tests/FunctionalDeprecated/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/FunctionalDeprecated/Comment/CommentTest.php b/tests/FunctionalDeprecated/Comment/CommentTest.php deleted file mode 100644 index 8d9c1d31..00000000 --- a/tests/FunctionalDeprecated/Comment/CommentTest.php +++ /dev/null @@ -1,27 +0,0 @@ -setComment($comment); - - self::assertSame('/*' . $comment . '*/', (string) $subject); - } -} diff --git a/tests/FunctionalDeprecated/Property/SelectorTest.php b/tests/FunctionalDeprecated/Property/SelectorTest.php deleted file mode 100644 index 917d227f..00000000 --- a/tests/FunctionalDeprecated/Property/SelectorTest.php +++ /dev/null @@ -1,25 +0,0 @@ -