From 50c69f83c868011217f652c897f28ce4fd3df5fa Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Wed, 13 May 2026 10:02:53 +0200 Subject: [PATCH] [TASK] Do not treat PHPDoc type information as certain This is a library. This means that we have no control over how other software calls our methods, and whether they adher to the types required via `@param` annotations. Hence, we shouldn't rely on those types being certain. --- Build/phpstan/phpstan-baseline.neon | 6 ------ Build/phpstan/phpstan.neon | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index b2f619bb..8bc0c554 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -48,12 +48,6 @@ parameters: count: 1 path: ../../src/Value/Value.php - - - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#' - identifier: staticMethod.impossibleType - count: 1 - path: ../../tests/ParserTest.php - - message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#' identifier: argument.type diff --git a/Build/phpstan/phpstan.neon b/Build/phpstan/phpstan.neon index c800482b..46e8153d 100644 --- a/Build/phpstan/phpstan.neon +++ b/Build/phpstan/phpstan.neon @@ -11,6 +11,8 @@ parameters: - %currentWorkingDirectory%/src/ - %currentWorkingDirectory%/tests/ + treatPhpDocTypesAsCertain: false + type_perfect: no_mixed_property: true no_mixed_caller: true