From e021fc66d0c60b67a4ca862e51b7c2393289bef2 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 9 Feb 2025 10:34:06 +0100 Subject: [PATCH] [TASK] Raise PHPStan to level 3 --- config/phpstan-baseline.neon | 37 +++++++++++++++++++++++++++++++++++- config/phpstan.neon | 2 +- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 81ecb713..eb3026f7 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -12,6 +12,18 @@ parameters: count: 1 path: ../src/CSSList/AtRuleBlockList.php + - + message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allSelectors\(\) expects array\, array\ given\.$#' + identifier: parameterByRef.type + count: 2 + path: ../src/CSSList/CSSBlockList.php + + - + message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allValues\(\) expects array\, array\ given\.$#' + identifier: parameterByRef.type + count: 1 + path: ../src/CSSList/CSSBlockList.php + - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:safely\(\)\.$#' identifier: method.notFound @@ -78,12 +90,24 @@ 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 count: 1 path: ../src/Property/Charset.php + - + message: '#^Method Sabberworm\\CSS\\Property\\Charset\:\:atRuleArgs\(\) should return string but returns Sabberworm\\CSS\\Value\\CSSString\.$#' + identifier: return.type + count: 1 + path: ../src/Property/Charset.php + - message: '#^PHPDoc tag @param references unknown parameter\: \$oCharset$#' identifier: parameter.notFound @@ -96,6 +120,12 @@ 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 @@ -150,6 +180,12 @@ parameters: count: 1 path: ../src/RuleSet/DeclarationBlock.php + - + message: '#^Argument of an invalid type Sabberworm\\CSS\\Rule\\Rule supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 2 + path: ../src/RuleSet/RuleSet.php + - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:removeLastSemicolon\(\)\.$#' identifier: method.notFound @@ -228,4 +264,3 @@ parameters: count: 1 path: ../src/Value/ValueList.php - diff --git a/config/phpstan.neon b/config/phpstan.neon index b6be40fd..910181dd 100644 --- a/config/phpstan.neon +++ b/config/phpstan.neon @@ -6,7 +6,7 @@ parameters: # Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI maximumNumberOfProcesses: 5 - level: 2 + level: 3 paths: - %currentWorkingDirectory%/bin/