From 8c95542edbb723e432237f28ffb8f92b3f8fa554 Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 12:22:46 +0100 Subject: [PATCH 1/8] [TASK] create two versions of phpstan configuration and switch fom composer command to native phpstan command Related: #1827 --- Build/Scripts/runTests.sh | 10 +-- .../phpstan/TYPO3_12.4/phpstan-baseline.neon | 2 + Build/phpstan/{ => TYPO3_12.4}/phpstan.neon | 22 +++--- .../{ => TYPO3_13.4}/phpstan-baseline.neon | 8 +-- Build/phpstan/TYPO3_13.4/phpstan.neon | 71 +++++++++++++++++++ 5 files changed, 94 insertions(+), 19 deletions(-) create mode 100644 Build/phpstan/TYPO3_12.4/phpstan-baseline.neon rename Build/phpstan/{ => TYPO3_12.4}/phpstan.neon (67%) rename Build/phpstan/{ => TYPO3_13.4}/phpstan-baseline.neon (76%) create mode 100644 Build/phpstan/TYPO3_13.4/phpstan.neon diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 2e97d6da6..65c339ce8 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -677,13 +677,15 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? ;; phpstan) - COMMAND="composer check:php:stan" - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + PHPSTAN_CONFIG_FILE="Build/phpstan/TYPO3_${CORE_VERSION}/phpstan.neon" + COMMAND=(php -dxdebug.mode=off .Build/bin/phpstan analyse -c ${PHPSTAN_CONFIG_FILE} --no-progress --no-interaction --memory-limit 4G "$@") + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name phpstan-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; phpstanGenerateBaseline) - COMMAND="composer phpstan:baseline" - ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" + PHPSTAN_CONFIG_FILE="Build/phpstan/TYPO3_${CORE_VERSION}/phpstan.neon" + COMMAND=(php -dxdebug.mode=off .Build/bin/phpstan analyse -c ${PHPSTAN_CONFIG_FILE} --no-progress --no-interaction --memory-limit 4G --allow-empty-baseline --generate-baseline=Build/phpstan/TYPO3_${CORE_VERSION}/phpstan-baseline.neon) + ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name phpstan-baseline-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; shellcheck) diff --git a/Build/phpstan/TYPO3_12.4/phpstan-baseline.neon b/Build/phpstan/TYPO3_12.4/phpstan-baseline.neon new file mode 100644 index 000000000..364905f71 --- /dev/null +++ b/Build/phpstan/TYPO3_12.4/phpstan-baseline.neon @@ -0,0 +1,2 @@ +parameters: + ignoreErrors: diff --git a/Build/phpstan/phpstan.neon b/Build/phpstan/TYPO3_12.4/phpstan.neon similarity index 67% rename from Build/phpstan/phpstan.neon rename to Build/phpstan/TYPO3_12.4/phpstan.neon index a3fdc52ce..e8b3a3837 100644 --- a/Build/phpstan/phpstan.neon +++ b/Build/phpstan/TYPO3_12.4/phpstan.neon @@ -1,9 +1,9 @@ includes: - phpstan-baseline.neon - - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon - - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon - - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon - - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon parameters: phpVersion: 80100 @@ -11,10 +11,10 @@ parameters: level: 9 paths: - - ../../Classes - - ../../Configuration - - ../../Tests - - ../../ext_localconf.php + - ../../../Classes + - ../../../Configuration + - ../../../Tests + - ../../../ext_localconf.php type_coverage: return_type: 100 @@ -62,10 +62,10 @@ parameters: ignoreErrors: - message: '#Class cognitive complexity is#' - path: '../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - message: '#Cognitive complexity for#' - path: '../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' - path: '../../Tests/' + path: '../../../Tests/' diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/TYPO3_13.4/phpstan-baseline.neon similarity index 76% rename from Build/phpstan/phpstan-baseline.neon rename to Build/phpstan/TYPO3_13.4/phpstan-baseline.neon index 0912191aa..e85bc0fe7 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/TYPO3_13.4/phpstan-baseline.neon @@ -4,22 +4,22 @@ parameters: message: '#^Method TTN\\Tea\\Domain\\Repository\\TeaRepository\:\:findAllFromAllPages\(\) return type with generic interface TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface does not specify its types\: TKey, TValue$#' identifier: missingType.generics count: 1 - path: ../../Classes/Domain/Repository/TeaRepository.php + path: ../../../Classes/Domain/Repository/TeaRepository.php - message: '#^Method TTN\\Tea\\Domain\\Repository\\TeaRepository\:\:findByOwnerUid\(\) return type with generic interface TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface does not specify its types\: TKey, TValue$#' identifier: missingType.generics count: 1 - path: ../../Classes/Domain/Repository/TeaRepository.php + path: ../../../Classes/Domain/Repository/TeaRepository.php - message: '#^Cannot call method getUid\(\) on mixed\.$#' identifier: method.nonObject count: 1 - path: ../../Tests/Functional/Domain/Repository/TeaRepositoryTest.php + path: ../../../Tests/Functional/Domain/Repository/TeaRepositoryTest.php - message: '#^Mixed variable in a `\$result\-\>current\(\)\-\>\.\.\.\(\)` can skip important errors\. Make sure the type is known$#' identifier: typePerfect.noMixedMethodCaller count: 1 - path: ../../Tests/Functional/Domain/Repository/TeaRepositoryTest.php + path: ../../../Tests/Functional/Domain/Repository/TeaRepositoryTest.php diff --git a/Build/phpstan/TYPO3_13.4/phpstan.neon b/Build/phpstan/TYPO3_13.4/phpstan.neon new file mode 100644 index 000000000..e8b3a3837 --- /dev/null +++ b/Build/phpstan/TYPO3_13.4/phpstan.neon @@ -0,0 +1,71 @@ +includes: + - phpstan-baseline.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon + - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon + +parameters: + phpVersion: 80100 + + level: 9 + + paths: + - ../../../Classes + - ../../../Configuration + - ../../../Tests + - ../../../ext_localconf.php + + type_coverage: + return_type: 100 + param_type: 100 + property_type: 95 + + cognitive_complexity: + class: 10 + function: 5 + + type_perfect: + no_mixed_property: true + no_mixed_caller: true + null_over_false: true + narrow_param: true + narrow_return: true + + disallowedFunctionCalls: + - + function: + - 'var_dump()' + - 'xdebug_break()' + - 'debug()' + message: 'Use logging instead or remove if it was for debugging purposes.' + - + function: 'header()' + message: 'Use PSR-7 API instead' + + disallowedStaticCalls: + - + method: + - 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()' + - 'TYPO3\CMS\Core\Utility\DebugUtility::debug()' + message: 'Use logging instead or remove if it was for debugging purposes.' + + disallowedSuperglobals: + - + superglobal: + - '$_GET' + - '$_POST' + - '$_FILES' + - '$_SERVER' + message: 'Use PSR-7 API instead' + + ignoreErrors: + - + message: '#Class cognitive complexity is#' + path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + - + message: '#Cognitive complexity for#' + path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' + path: '../../../Tests/' From 01e9270c74f4aac2b964be0a10645f0e0f39c37a Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 12:39:33 +0100 Subject: [PATCH 2/8] [TASK] add matrix test for both TYPO3 versions to ci Related: #1827 --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0506cdab..0b82d259c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,30 @@ jobs: - "8.3" - "8.4" - "8.5" + php-stan: + name: PHPStan code quality checks + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Show the Composer version + run: ./Build/Scripts/runTests.sh -s composer -- --version + - name: Show the Composer configuration + run: ./Build/Scripts/runTests.sh -s composer config --global --list + - name: Install Composer dependencies + run: Build/Scripts/runTests.sh -s composerUpdateMax + - name: Install composer dependencies + run: | + ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s composer composerUpdateMax + - name: Run phpstan code quality checks + run: | + ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s phpstan + strategy: + fail-fast: false + matrix: + include: + - typo3-version: "12.4" + - typo3-version: "13.4" code-quality: name: Code quality checks runs-on: ubuntu-24.04 From 52c5c8915bdf7e3f88385ba7a1f068c3a187c8be Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 12:55:30 +0100 Subject: [PATCH 3/8] [TASK] remove phpstan composer command Related: #1827 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b82d259c..c0c2e70f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,6 @@ jobs: - "json:lint" - "php:cs-fixer" - "php:rector" - - "php:stan" - "typoscript:lint" - "xliff:lint" - "yaml:lint" From 5eef64cb0ab5029e64a37b3fd25a3caf26a1928d Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 12:56:39 +0100 Subject: [PATCH 4/8] [BUGFIX] use correct command Related: #1827 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0c2e70f1..55998a8d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: run: Build/Scripts/runTests.sh -s composerUpdateMax - name: Install composer dependencies run: | - ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s composer composerUpdateMax + ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s composerUpdateMax - name: Run phpstan code quality checks run: | ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s phpstan From 6e6066868594bd1a8db7e1333b5755d9f42ef2d2 Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 13:10:09 +0100 Subject: [PATCH 5/8] [TASK] add php version to matrix Related: #1827 --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55998a8d6..af88942fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,16 +46,18 @@ jobs: run: Build/Scripts/runTests.sh -s composerUpdateMax - name: Install composer dependencies run: | - ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s composerUpdateMax + ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdateMax - name: Run phpstan code quality checks run: | - ./Build/Scripts/runTests.sh -t ${{matrix.typo3-version}} -s phpstan + ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s phpstan strategy: fail-fast: false matrix: include: - typo3-version: "12.4" + php-version: "8.2" - typo3-version: "13.4" + php-version: "8.2" code-quality: name: Code quality checks runs-on: ubuntu-24.04 From 8ac72353cf6d50481315b2832fb29435f9e0f1e9 Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 13:21:27 +0100 Subject: [PATCH 6/8] [BUGFIX] remove duplicate composerUpdateMax Related: #1827 --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af88942fc..284fbac46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,6 @@ jobs: run: ./Build/Scripts/runTests.sh -s composer -- --version - name: Show the Composer configuration run: ./Build/Scripts/runTests.sh -s composer config --global --list - - name: Install Composer dependencies - run: Build/Scripts/runTests.sh -s composerUpdateMax - name: Install composer dependencies run: | ./Build/Scripts/runTests.sh -p ${{ matrix.php-version }} -t ${{matrix.typo3-version}} -s composerUpdateMax From 0fa9260eafe71afcc1f9b56a9d36df8f83576737 Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 14:56:47 +0100 Subject: [PATCH 7/8] [TASK] remove no longer needed composer phpstan commands Related: #1827 --- composer.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 48f19e8ce..e547c616c 100644 --- a/composer.json +++ b/composer.json @@ -136,13 +136,11 @@ "check:json:lint": "find . ! -path '*/.cache/*' ! -path '*/.Build/*' ! -path '*/node_modules/*' -name '*.json' | xargs -r php .Build/bin/jsonlint -q", "check:php": [ "@check:php:cs-fixer", - "@check:php:lint", - "@check:php:stan" + "@check:php:lint" ], "check:php:cs-fixer": "php-cs-fixer fix --config ./Build/php-cs-fixer/config.php -v --dry-run --diff", "check:php:lint": "parallel-lint *.php Build Classes Configuration Tests", "check:php:rector": "rector process --dry-run --config=./Build/rector/config.php", - "check:php:stan": "phpstan --no-progress -v --configuration=Build/phpstan/phpstan.neon", "check:static": [ "@check:composer:normalize", "@check:composer:unused", @@ -150,7 +148,6 @@ "@check:php:lint", "@check:composer:psr-verify", "@check:php:rector", - "@check:php:stan", "@check:php:cs-fixer", "@check:typoscript:lint", "@check:xliff:lint", @@ -177,7 +174,6 @@ ], "fix:php:cs-fixer": "php-cs-fixer fix --config ./Build/php-cs-fixer/config.php", "fix:php:rector": "rector process --config=./Build/rector/config.php", - "phpstan:baseline": "phpstan --generate-baseline=Build/phpstan/phpstan-baseline.neon --allow-empty-baseline --configuration=Build/phpstan/phpstan.neon", "prepare-release": [ "rm -rf .Build", "rm -rf .ddev", @@ -208,7 +204,6 @@ "check:php:lint": "Lints the PHP files for syntax errors.", "check:php:mess": "Runs PHP mess detection.", "check:php:rector": "Checks for code for changes by Rector.", - "check:php:stan": "Checks the PHP types using PHPStan.", "check:static": "Runs all static code checks (syntax, style, types).", "check:tests:create-directories": "Creates the directories required to smoothely run the functional tests.", "check:tests:functional": "Runs the functional tests.", @@ -222,7 +217,6 @@ "fix:php": "Runs all fixers for the PHP code.", "fix:php:cs-fixer": "Fixes the code style with PHP-CS-Fixer.", "fix:php:rector": "Updates the code with Rector.", - "phpstan:baseline": "Updates the PHPStan baseline file to match the code.", "prepare-release": "Removes development-only files in preparation of a TER release." } } From bc6a4f884f314dd6060a4a91ef5dafd96fe0bdab Mon Sep 17 00:00:00 2001 From: Eike Starkmann Date: Sat, 28 Mar 2026 16:27:25 +0100 Subject: [PATCH 8/8] [TASK] create a base phpstan config to remove dublicate code Related: #1827 --- Build/phpstan/TYPO3_12.4/phpstan.neon | 67 +------------------------- Build/phpstan/TYPO3_13.4/phpstan.neon | 68 +-------------------------- Build/phpstan/phpstan.neon | 68 +++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 132 deletions(-) create mode 100644 Build/phpstan/phpstan.neon diff --git a/Build/phpstan/TYPO3_12.4/phpstan.neon b/Build/phpstan/TYPO3_12.4/phpstan.neon index e8b3a3837..1b8a6544b 100644 --- a/Build/phpstan/TYPO3_12.4/phpstan.neon +++ b/Build/phpstan/TYPO3_12.4/phpstan.neon @@ -1,71 +1,6 @@ includes: + - ../phpstan.neon - phpstan-baseline.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon parameters: phpVersion: 80100 - - level: 9 - - paths: - - ../../../Classes - - ../../../Configuration - - ../../../Tests - - ../../../ext_localconf.php - - type_coverage: - return_type: 100 - param_type: 100 - property_type: 95 - - cognitive_complexity: - class: 10 - function: 5 - - type_perfect: - no_mixed_property: true - no_mixed_caller: true - null_over_false: true - narrow_param: true - narrow_return: true - - disallowedFunctionCalls: - - - function: - - 'var_dump()' - - 'xdebug_break()' - - 'debug()' - message: 'Use logging instead or remove if it was for debugging purposes.' - - - function: 'header()' - message: 'Use PSR-7 API instead' - - disallowedStaticCalls: - - - method: - - 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()' - - 'TYPO3\CMS\Core\Utility\DebugUtility::debug()' - message: 'Use logging instead or remove if it was for debugging purposes.' - - disallowedSuperglobals: - - - superglobal: - - '$_GET' - - '$_POST' - - '$_FILES' - - '$_SERVER' - message: 'Use PSR-7 API instead' - - ignoreErrors: - - - message: '#Class cognitive complexity is#' - path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - - - message: '#Cognitive complexity for#' - path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - - - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' - path: '../../../Tests/' diff --git a/Build/phpstan/TYPO3_13.4/phpstan.neon b/Build/phpstan/TYPO3_13.4/phpstan.neon index e8b3a3837..f42a58832 100644 --- a/Build/phpstan/TYPO3_13.4/phpstan.neon +++ b/Build/phpstan/TYPO3_13.4/phpstan.neon @@ -1,71 +1,7 @@ includes: + - ../phpstan.neon - phpstan-baseline.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon - - ../../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon parameters: - phpVersion: 80100 + phpVersion: 80200 - level: 9 - - paths: - - ../../../Classes - - ../../../Configuration - - ../../../Tests - - ../../../ext_localconf.php - - type_coverage: - return_type: 100 - param_type: 100 - property_type: 95 - - cognitive_complexity: - class: 10 - function: 5 - - type_perfect: - no_mixed_property: true - no_mixed_caller: true - null_over_false: true - narrow_param: true - narrow_return: true - - disallowedFunctionCalls: - - - function: - - 'var_dump()' - - 'xdebug_break()' - - 'debug()' - message: 'Use logging instead or remove if it was for debugging purposes.' - - - function: 'header()' - message: 'Use PSR-7 API instead' - - disallowedStaticCalls: - - - method: - - 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()' - - 'TYPO3\CMS\Core\Utility\DebugUtility::debug()' - message: 'Use logging instead or remove if it was for debugging purposes.' - - disallowedSuperglobals: - - - superglobal: - - '$_GET' - - '$_POST' - - '$_FILES' - - '$_SERVER' - message: 'Use PSR-7 API instead' - - ignoreErrors: - - - message: '#Class cognitive complexity is#' - path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - - - message: '#Cognitive complexity for#' - path: '../../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' - - - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' - path: '../../../Tests/' diff --git a/Build/phpstan/phpstan.neon b/Build/phpstan/phpstan.neon new file mode 100644 index 000000000..829b53b23 --- /dev/null +++ b/Build/phpstan/phpstan.neon @@ -0,0 +1,68 @@ +includes: + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon + - ../../.Build/vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon + +parameters: + level: 9 + + paths: + - ../../Classes + - ../../Configuration + - ../../Tests + - ../../ext_localconf.php + + type_coverage: + return_type: 100 + param_type: 100 + property_type: 95 + + cognitive_complexity: + class: 10 + function: 5 + + type_perfect: + no_mixed_property: true + no_mixed_caller: true + null_over_false: true + narrow_param: true + narrow_return: true + + disallowedFunctionCalls: + - + function: + - 'var_dump()' + - 'xdebug_break()' + - 'debug()' + message: 'Use logging instead or remove if it was for debugging purposes.' + - + function: 'header()' + message: 'Use PSR-7 API instead' + + disallowedStaticCalls: + - + method: + - 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()' + - 'TYPO3\CMS\Core\Utility\DebugUtility::debug()' + message: 'Use logging instead or remove if it was for debugging purposes.' + + disallowedSuperglobals: + - + superglobal: + - '$_GET' + - '$_POST' + - '$_FILES' + - '$_SERVER' + message: 'Use PSR-7 API instead' + + ignoreErrors: + - + message: '#Class cognitive complexity is#' + path: '../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + - + message: '#Cognitive complexity for#' + path: '../../Classes/Upgrades/AbstractListTypeToCTypeUpdate.php' + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' + path: '../../Tests/'