Make PHPStan more strict

Changes the PHPStan configuration to make it stricter, like the
Psalm's configuration.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-07-24 22:16:19 -03:00
parent 843c5bb09a
commit bf247e8a22
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
2 changed files with 24394 additions and 196 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,37 +3,35 @@ includes:
parameters:
level: max
paths:
- .
- libraries
- public
- test
scanFiles:
- libraries/constants.php
- examples/signon-script.php
bootstrapFiles:
- test/phpstan-constants.php
stubFiles:
- test/stubs/Query.stub
- test/stubs/uploadprogress.stub
excludePaths:
- examples/openid.php
- node_modules/*
- libraries/cache/*
- test/doctum-config.php
- tmp/*
- twig-templates/*
- vendor/*
dynamicConstantNames:
- ROOT_PATH
- TEST_PATH
- VERSION_SUFFIX
strictRules:
# Allow non-booleans in conditions.
booleansInConditions: false
# Allow the empty() construct.
disallowedConstructs: false
# Allow dynamic calls to static methods.
strictCalls: false
checkBenevolentUnionTypes: true
checkAlwaysTrueCheckTypeFunctionCall: true
checkAlwaysTrueStrictComparison: true
checkUninitializedProperties: true
polluteScopeWithAlwaysIterableForeach: true
checkDynamicProperties: true
checkTooWideReturnTypesInProtectedAndPublicMethods: true
polluteScopeWithLoopInitialAssignments: true
checkImplicitMixed: true
ignoreErrors:
-
message: '#Dynamic call to static method PHPUnit\\Framework\\Assert::[a-zA-Z]+\(\)\.#'
paths:
- test/classes/*
- test/selenium/*
-
message: '#Dynamic call to static method PHPUnit\\Framework\\TestCase::[a-zA-Z]+\(\)\.#'
path: test/classes/*