From acc394e88e15c947f4a61355bd7c15e1e622fca2 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 7 Mar 2025 17:54:56 +0100 Subject: [PATCH] [TASK ] Remove `OutputFormat::set()` Part of #1103 Closes #1103 --- CHANGELOG.md | 2 +- config/phpstan-baseline.neon | 12 ------------ src/OutputFormat.php | 36 ------------------------------------ 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89caf5a7..495f8d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ Please also have a look at our ### Removed -- Remove `OutputFormat::get()` (#1108) +- Remove `OutputFormat::get()` and `::set()` (#1108, #1110) - Drop special support for vendor prefixes (#1083) - Remove the IE hack in `Rule` (#995) - Drop `getLineNo()` from the `Renderable` interface (#1038) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index ecced88c..df371d85 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -102,18 +102,6 @@ parameters: count: 2 path: ../src/CSSList/KeyFrame.php - - - message: '#^Returning false in non return bool class method\. Use null with type\|null instead or add bool return type$#' - identifier: typePerfect.nullOverFalse - count: 1 - path: ../src/OutputFormat.php - - - - message: '#^Variable property access on \$this\(Sabberworm\\CSS\\OutputFormat\)\.$#' - identifier: property.dynamicName - count: 2 - path: ../src/OutputFormat.php - - message: '#^Default value of the parameter \#2 \$bIncludeEnd \(false\) of method Sabberworm\\CSS\\Parsing\\ParserState\:\:consumeUntil\(\) is incompatible with type string\.$#' identifier: parameter.defaultValue diff --git a/src/OutputFormat.php b/src/OutputFormat.php index 0d83c4ee..c3e5f996 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -182,42 +182,6 @@ class OutputFormat public function __construct() {} - /** - * @param array|string $names - * @param mixed $value - * - * @return self|false - */ - public function set($names, $value) - { - $aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i']; - if (\is_string($names) && \strpos($names, '*') !== false) { - $names = - [ - \str_replace('*', 'Before', $names), - \str_replace('*', 'Between', $names), - \str_replace('*', 'After', $names), - ]; - } elseif (!\is_array($names)) { - $names = [$names]; - } - foreach ($aVarPrefixes as $prefix) { - $bDidReplace = false; - foreach ($names as $name) { - $sFieldName = $prefix . \ucfirst($name); - if (isset($this->$sFieldName)) { - $this->$sFieldName = $value; - $bDidReplace = true; - } - } - if ($bDidReplace) { - return $this; - } - } - // Break the chain so the user knows this option is invalid - return false; - } - /** * @param non-empty-string $sMethodName * @param array $arguments