From cd31f9bfc0188bd46747becce3756780434b7ffc Mon Sep 17 00:00:00 2001 From: Alexander Schnitzler <git@alexanderschnitzler.de> Date: Sat, 26 Sep 2020 17:07:57 +0200 Subject: [PATCH] [TASK] Remove Build/phpstan.level2.neon Since all level 2 rules are active and only level 2 parameters are set to different values compared to their originally declared value, the whole file can be removed, the overall phpstan level can be raised to 2 and the parameters can be defined in the main phpstan file. Releases: master, 10.4 Resolves: #92424 Change-Id: I8404f5f2f4ff318bb3419ed307b1ffe7edcc6822 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65902 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Daniel Goerz <daniel.goerz@posteo.de> Tested-by: Alexander Schnitzler <git@alexanderschnitzler.de> Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Alexander Schnitzler <git@alexanderschnitzler.de> --- Build/phpstan.level2.neon | 56 --------------------------------------- Build/phpstan.level3.neon | 3 --- phpstan.neon | 8 +++++- 3 files changed, 7 insertions(+), 60 deletions(-) delete mode 100644 Build/phpstan.level2.neon diff --git a/Build/phpstan.level2.neon b/Build/phpstan.level2.neon deleted file mode 100644 index f0aac63f51ef..000000000000 --- a/Build/phpstan.level2.neon +++ /dev/null @@ -1,56 +0,0 @@ -parameters: - checkClassCaseSensitivity: true -# checkThisOnly: false - checkPhpDocMissingReturn: false # todo: set to true - -rules: - - PHPStan\Rules\Cast\EchoRule - - PHPStan\Rules\Cast\InvalidCastRule - - PHPStan\Rules\Cast\InvalidPartOfEncapsedStringRule - - PHPStan\Rules\Cast\PrintRule - - PHPStan\Rules\Functions\IncompatibleDefaultParameterTypeRule - - PHPStan\Rules\Generics\ClassAncestorsRule - - PHPStan\Rules\Generics\ClassTemplateTypeRule - - PHPStan\Rules\Generics\FunctionTemplateTypeRule - - PHPStan\Rules\Generics\FunctionSignatureVarianceRule - - PHPStan\Rules\Generics\InterfaceAncestorsRule - - PHPStan\Rules\Generics\InterfaceTemplateTypeRule - - PHPStan\Rules\Generics\MethodTemplateTypeRule - - PHPStan\Rules\Generics\MethodSignatureVarianceRule - - PHPStan\Rules\Generics\TraitTemplateTypeRule - - PHPStan\Rules\Methods\IncompatibleDefaultParameterTypeRule - - PHPStan\Rules\Operators\InvalidBinaryOperationRule - - PHPStan\Rules\Operators\InvalidUnaryOperationRule - - PHPStan\Rules\Operators\InvalidComparisonOperationRule - - PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule - - PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule - - PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule - - PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule - - PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule - - PHPStan\Rules\PhpDoc\WrongVariableNameInVarTagRule - -services: - - - class: PHPStan\Rules\Classes\MixinRule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\Functions\CallCallablesRule - arguments: - reportMaybes: %reportMaybes% - - tags: - - phpstan.rules.rule - - - - class: PHPStan\Rules\PhpDoc\InvalidPhpDocVarTagTypeRule - arguments: - checkClassCaseSensitivity: %checkClassCaseSensitivity% - checkMissingVarTagTypehint: %checkMissingVarTagTypehint% - - tags: - - phpstan.rules.rule diff --git a/Build/phpstan.level3.neon b/Build/phpstan.level3.neon index a93009e2bd2c..7eca0f571784 100644 --- a/Build/phpstan.level3.neon +++ b/Build/phpstan.level3.neon @@ -1,6 +1,3 @@ -includes: - - phpstan.level2.neon - rules: # - PHPStan\Rules\Arrays\AppendedArrayItemTypeRule - PHPStan\Rules\Arrays\IterableInForeachRule diff --git a/phpstan.neon b/phpstan.neon index 12b88e37a611..255d7ff7b1e6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,13 @@ includes: # - vendor/phpstan/phpstan/conf/bleedingEdge.neon parameters: - level: 1 + level: 2 + + # level 2 parameters which are set to opposite values in the original level 2 configuration. Parameters need to be + # set to their opposite values and the resulting errors need to be fixed. Once they are fixed, the parameters can be + # removed from this file. + checkThisOnly: true + checkPhpDocMissingReturn: false # Set to true during local runs to find unmatched ignored errors. bamboo needs this to be set to false. reportUnmatchedIgnoredErrors: false -- GitLab