Add PHPStan and other quality checks

Similar to FreshRSS core
Contributes to https://github.com/FreshRSS/Extensions/issues/184
This commit is contained in:
Alexandre Alapetite 2023-11-23 22:41:09 +01:00
parent a86467db48
commit b49596818c
No known key found for this signature in database
GPG key ID: A24378C38E812B23
59 changed files with 1173 additions and 404 deletions

39
phpstan.neon Normal file
View file

@ -0,0 +1,39 @@
parameters:
# TODO: Increase rule-level https://phpstan.org/user-guide/rule-levels
level: 1
treatPhpDocTypesAsCertain: false
fileExtensions:
- php
- phtml
paths:
- ../FreshRSS
- .
excludePaths:
analyse:
- ../FreshRSS
- vendor/
analyseAndScan:
- .git/
- node_modules/
- symbolic/
- tmp/
- xExtension-TTRSS_API/
dynamicConstantNames:
- TYPE_GIT
reportMaybesInPropertyPhpDocTypes: false
strictRules:
allRules: false
booleansInConditions: false # TODO pass
closureUsesThis: true
disallowedConstructs: false
disallowedLooseComparison: false
matchingInheritedMethodNames: true
noVariableVariables: false # TODO pass
numericOperandsInArithmeticOperators: true
overwriteVariablesWithLoop: true
requireParentConstructorCall: true
strictCalls: true
switchConditionsMatchingType: true
uselessCast: true
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon