From d40fa1658367c11f07a69747fdd9e0f37f637248 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 11 Mar 2025 23:20:33 +0100 Subject: [PATCH] [TASK] Drop `atRuleArgs()` from the `AtRule` interface The classes implementing this interface use a wide variaty of inconsistent return types when they implement this method. This is a hard blocker for introducing native return type declaration for this method. --- CHANGELOG.md | 1 + config/phpstan-baseline.neon | 12 ------------ src/Property/AtRule.php | 5 ----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a0338a..1537b5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Please also have a look at our ### Removed +- Drop `atRuleArgs()` from the `AtRule` interface (#1141) - Remove `OutputFormat::get()` and `::set()` (#1108, #1110) - Drop special support for vendor prefixes (#1083) - Remove the IE hack in `Rule` (#995) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 6c0a6d88..e78e9794 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -120,12 +120,6 @@ parameters: count: 1 path: ../src/Property/CSSNamespace.php - - - message: '#^Return type \(array\\) of method Sabberworm\\CSS\\Property\\CSSNamespace\:\:atRuleArgs\(\) should be compatible with return type \(string\|null\) of method Sabberworm\\CSS\\Property\\AtRule\:\:atRuleArgs\(\)$#' - identifier: method.childReturnType - count: 1 - path: ../src/Property/CSSNamespace.php - - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#' identifier: method.notFound @@ -150,12 +144,6 @@ parameters: count: 1 path: ../src/Property/Import.php - - - message: '#^Return type \(array\\) of method Sabberworm\\CSS\\Property\\Import\:\:atRuleArgs\(\) should be compatible with return type \(string\|null\) of method Sabberworm\\CSS\\Property\\AtRule\:\:atRuleArgs\(\)$#' - identifier: method.childReturnType - count: 1 - path: ../src/Property/Import.php - - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#' identifier: method.notFound diff --git a/src/Property/AtRule.php b/src/Property/AtRule.php index f4b7c724..e3324c80 100644 --- a/src/Property/AtRule.php +++ b/src/Property/AtRule.php @@ -23,9 +23,4 @@ interface AtRule extends Renderable, Commentable * @return string|null */ public function atRuleName(); - - /** - * @return string|null - */ - public function atRuleArgs(); }