[TASK] Revamp phpstan config and handling
We currently have the situation that phpstan is hard to update and maintain due to the phpstan config file that sets very specific rulesets. This is unfortunate since phpstan tends to change and rename rules at will. The general usage API of phpstan is basically as follows: Have a slim config file that sets the basic level. Then maintain a 'baseline' file that lists violations, using the --generate-baseline command option. The todo job for people working on phpstan errors is then to look at the baseline file, pick up some issues, fix them, then re-generate baseline. When baseline is small enough, the level is raised, a new baseline is generated, and the fix-job starts again. The patch does exactly this: The existing config is dropped and runTests.sh receives a command to generate baseline. With this in place, we can easily raise phpstan to a PHP 8.1 compatible version: > composer req friendsoftypo3/phpstan-typo3:"^0.9.0" --dev > composer req phpstan/phpstan:"^1.4.3" --dev > Build/Script/runTests.sh -s phpstanGenerateBaseline This initialy adds about 4000 ignores to the baseline with level 3, but we can reduce this drastically with just a couple of dedicated patches, soon. The config is heavily streamlined and for instance does *not* ignore tests anymore, which actually finds a ton of misuses and bugs within tests and classes. Resolves: #96675 Releases: main, 11.5 Change-Id: I0e7ff7aa796e59a2c5eedde0b673f741f8b87dea Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73037 Tested-by:core-ci <typo3@b13.com> Tested-by:
Daniel Goerz <daniel.goerz@posteo.de> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Daniel Goerz <daniel.goerz@posteo.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- Build/Scripts/runTests.sh 7 additions, 2 deletionsBuild/Scripts/runTests.sh
- Build/gitlab-ci/nightly/integrity.yml 1 addition, 2 deletionsBuild/gitlab-ci/nightly/integrity.yml
- Build/gitlab-ci/pre-merge/integrity.yml 1 addition, 2 deletionsBuild/gitlab-ci/pre-merge/integrity.yml
- Build/phpstan.level3.neon 0 additions, 100 deletionsBuild/phpstan.level3.neon
- Build/phpstan.level4.neon 0 additions, 188 deletionsBuild/phpstan.level4.neon
- Build/phpstan.level5.neon 0 additions, 20 deletionsBuild/phpstan.level5.neon
- Build/phpstan.level6.neon 0 additions, 16 deletionsBuild/phpstan.level6.neon
- Build/phpstan.level7.neon 0 additions, 6 deletionsBuild/phpstan.level7.neon
- Build/phpstan.level8.neon 0 additions, 5 deletionsBuild/phpstan.level8.neon
- Build/phpstan.php8config.php 0 additions, 68 deletionsBuild/phpstan.php8config.php
- Build/phpstan/phpstan-baseline.neon 10082 additions, 0 deletionsBuild/phpstan/phpstan-baseline.neon
- Build/phpstan/phpstan-constants.php 4 additions, 0 deletionsBuild/phpstan/phpstan-constants.php
- Build/phpstan/phpstan.neon 27 additions, 0 deletionsBuild/phpstan/phpstan.neon
- Build/testing-docker/local/docker-compose.yml 16 additions, 1 deletionBuild/testing-docker/local/docker-compose.yml
- composer.json 2 additions, 2 deletionscomposer.json
- composer.lock 16 additions, 16 deletionscomposer.lock
- phpstan.neon 0 additions, 227 deletionsphpstan.neon
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler/Classes/Tca/SelectElementItems.php 1 addition, 3 deletions...sions/test_datahandler/Classes/Tca/SelectElementItems.php
- typo3/sysext/core/Tests/Unit/Database/Mocks/MockPlatform.php 5 additions, 20 deletionstypo3/sysext/core/Tests/Unit/Database/Mocks/MockPlatform.php
- typo3/sysext/core/Tests/Unit/Mail/Fixtures/FakeValidSpoolFixture.php 2 additions, 1 deletion...t/core/Tests/Unit/Mail/Fixtures/FakeValidSpoolFixture.php
Please register or sign in to comment