From 6e2fa4f8d6f2ca99564c4ac0978d0d479065a8c1 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Mon, 10 Mar 2025 09:36:34 +0100 Subject: [PATCH] [TASK] Mark the `OutputFormat` as not extendable This is the V8.x backport of #1131. --- CHANGELOG.md | 2 ++ src/OutputFormat.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e744f1e2..ea3474c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Changed +- Mark the `OutputFormat` the constructor as `@internal` (#1131) - Mark `OutputFormatter` as `@internal` (#896) - Mark `Selector::isValid()` as `@internal` (#1037) - Mark parsing-related methods of most CSS elements as `@internal` (#908) @@ -19,6 +20,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Deprecated +- Deprecate extending `OutputFormat` (#1131) - Deprecate `OutputFormat::get()` and `::set()` (#1107) - Deprecate support for `-webkit-calc` and `-moz-calc` (#1086) - Deprecate `__toString()` (#1006) diff --git a/src/OutputFormat.php b/src/OutputFormat.php index d31ef4ff..9778e274 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -3,7 +3,7 @@ namespace Sabberworm\CSS; /** - * Class OutputFormat + * Extending this class is deprecated in version 8.8.0; it will be made `final` in version 9.0.0. * * @method OutputFormat setSemicolonAfterLastRule(bool $bSemicolonAfterLastRule) Set whether semicolons are added after * last rule. @@ -239,6 +239,9 @@ class OutputFormat */ private $iIndentationLevel = 0; + /** + * @internal since V8.8.0. Use the factory methods `create()`, `createCompact()`, or `createPretty()` instead. + */ public function __construct() { }