From d3a7aad34d15a77177e027ae89bd8fafde80a291 Mon Sep 17 00:00:00 2001 From: Anna Reiter Date: Fri, 17 Apr 2026 12:37:15 +0200 Subject: [PATCH] [CLEANUP] Move PHPStan configuration to `Build/` --- .../phpstan}/phpstan-baseline.neon | 36 +++++++++---------- {config => Build/phpstan}/phpstan.neon | 2 +- composer.json | 6 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) rename {config => Build/phpstan}/phpstan-baseline.neon (83%) rename {config => Build/phpstan}/phpstan.neon (91%) diff --git a/config/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon similarity index 83% rename from config/phpstan-baseline.neon rename to Build/phpstan/phpstan-baseline.neon index 49ebbf94..ba20ce23 100644 --- a/config/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -4,106 +4,106 @@ parameters: message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\CSSString\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|Sabberworm\\CSS\\Value\\URL given\.$#' identifier: argument.type count: 1 - path: ../src/CSSList/CSSList.php + path: ../../src/CSSList/CSSList.php - message: '#^Parameters should have "Sabberworm\\CSS\\CSSList\\CSSListItem\|array" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType count: 1 - path: ../src/CSSList/CSSList.php + path: ../../src/CSSList/CSSList.php - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue count: 1 - path: ../src/Parsing/ParserState.php + path: ../../src/Parsing/ParserState.php - message: '#^Parameters should have "string\|int\|null" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType count: 1 - path: ../src/Parsing/ParserState.php + path: ../../src/Parsing/ParserState.php - message: '#^Parameters should have "string" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType count: 1 - path: ../src/RuleSet/DeclarationBlock.php + path: ../../src/RuleSet/DeclarationBlock.php - message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#' identifier: argument.type count: 1 - path: ../src/Value/CSSFunction.php + path: ../../src/Value/CSSFunction.php - message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#' identifier: argument.type count: 2 - path: ../src/Value/CalcFunction.php + path: ../../src/Value/CalcFunction.php - message: '#^Cannot call method getSize\(\) on Sabberworm\\CSS\\Value\\Value\|string\.$#' identifier: method.nonObject count: 3 - path: ../src/Value/Color.php + path: ../../src/Value/Color.php - message: '#^Parameters should have "float" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType count: 1 - path: ../src/Value/Size.php + path: ../../src/Value/Size.php - message: '#^Strict comparison using \!\=\= between non\-empty\-string and null will always evaluate to true\.$#' identifier: notIdentical.alwaysTrue count: 1 - path: ../src/Value/Size.php + path: ../../src/Value/Size.php - message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#' identifier: argument.type count: 1 - path: ../src/Value/Value.php + path: ../../src/Value/Value.php - message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#' identifier: argument.type count: 1 - path: ../src/Value/Value.php + 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 + 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 count: 3 - path: ../tests/RuleSet/DeclarationBlockTest.php + path: ../../tests/RuleSet/DeclarationBlockTest.php - message: '#^Parameter \#1 \$type of class Sabberworm\\CSS\\CSSList\\AtRuleBlockList constructor expects non\-empty\-string, '''' given\.$#' identifier: argument.type count: 3 - path: ../tests/Unit/CSSList/AtRuleBlockListTest.php + path: ../../tests/Unit/CSSList/AtRuleBlockListTest.php - message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSFunction given\.$#' identifier: argument.type count: 2 - path: ../tests/Unit/CSSList/CSSBlockListTest.php + path: ../../tests/Unit/CSSList/CSSBlockListTest.php - message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSString given\.$#' identifier: argument.type count: 10 - path: ../tests/Unit/CSSList/CSSBlockListTest.php + path: ../../tests/Unit/CSSList/CSSBlockListTest.php - message: '#^Parameter \#1 \$selectors of method Sabberworm\\CSS\\CSSList\\CSSList\:\:removeDeclarationBlockBySelector\(\) expects array\\|Sabberworm\\CSS\\RuleSet\\DeclarationBlock\|string, array\ given\.$#' identifier: argument.type count: 2 - path: ../tests/Unit/CSSList/CSSListTest.php + path: ../../tests/Unit/CSSList/CSSListTest.php diff --git a/config/phpstan.neon b/Build/phpstan/phpstan.neon similarity index 91% rename from config/phpstan.neon rename to Build/phpstan/phpstan.neon index ec625a44..06a67368 100644 --- a/config/phpstan.neon +++ b/Build/phpstan/phpstan.neon @@ -21,4 +21,4 @@ parameters: ignoreErrors: - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' - path: '../tests/' + path: '%currentWorkingDirectory%/tests/' diff --git a/composer.json b/composer.json index 5c240cf5..4d897475 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,7 @@ "check:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin config src tests", "check:php:lint": "parallel-lint bin config src tests", "check:php:rector": "rector process --no-progress-bar --dry-run --config=config/rector.php", - "check:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon", + "check:php:stan": "phpstan --no-progress --configuration=./Build/phpstan/phpstan.neon", "check:static": [ "@check:composer:normalize", "@check:php:fixer", @@ -112,8 +112,8 @@ "fix:php:codesniffer": "phpcbf --standard=config/phpcs.xml bin config src tests", "fix:php:fixer": "\"./.phive/php-cs-fixer\" --config=config/php-cs-fixer.php fix bin config src tests", "fix:php:rector": "rector process --config=config/rector.php", - "phpstan:baseline": "phpstan --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon --allow-empty-baseline", - "phpstan:clearcache": "phpstan clear-result-cache" + "phpstan:baseline": "phpstan --configuration=./Build/phpstan/phpstan.neon --generate-baseline=./Build/phpstan/phpstan-baseline.neon --allow-empty-baseline", + "phpstan:clearcache": "phpstan clear-result-cache --configuration=./Build/phpstan/phpstan.neon" }, "scripts-descriptions": { "check": "Runs all dynamic and static code checks.",