Initial
This commit is contained in:
commit
0faf2879df
11
README.org
Normal file
11
README.org
Normal file
|
@ -0,0 +1,11 @@
|
|||
* Quality Assurance Settings for museum-digital
|
||||
|
||||
** Tools used
|
||||
|
||||
- [[https://github.com/squizlabs/PHP_CodeSniffer][php-codesniffer]]
|
||||
- [[https://github.com/phpstan/phpstan][PHPStan - PHP Static Analysis Tool]]
|
||||
- [[https://phpunit.de/][phpunit]]
|
||||
|
||||
** This Repository
|
||||
|
||||
This repository serves to collect generally applicable rules, that can be embedded into the specific rule sets of the different projects.
|
123
rules/phpstan-rules.neon
Normal file
123
rules/phpstan-rules.neon
Normal file
|
@ -0,0 +1,123 @@
|
|||
includes:
|
||||
- ../../../vendor/phpstan/phpstan/conf/bleedingEdge.neon
|
||||
- ../../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
- '#Class (MDMysqliInvalidInput|MDMysqliExpectedError|MDExpectedException|MDgenericInvalidInputsException) is neither abstract nor final.#'
|
||||
- '#Method MDMysqli::_check_query_efficiency\(\) is unused.#'
|
||||
polluteScopeWithLoopInitialAssignments: false
|
||||
polluteScopeWithAlwaysIterableForeach: false
|
||||
checkAlwaysTrueCheckTypeFunctionCall: true
|
||||
checkAlwaysTrueInstanceof: true
|
||||
checkAlwaysTrueStrictComparison: true
|
||||
checkExplicitMixedMissingReturn: true
|
||||
checkFunctionNameCase: true
|
||||
checkMissingClosureNativeReturnTypehintRule: true
|
||||
reportMaybesInMethodSignatures: true
|
||||
reportStaticMethodSignatures: true
|
||||
ergebnis:
|
||||
allowAbstractClasses: true
|
||||
classesNotRequiredToBeAbstractOrFinal: []
|
||||
interfacesImplementedByContainers:
|
||||
- Psr\Container\ContainerInterface
|
||||
classesAllowedToBeExtended:
|
||||
- mysqli
|
||||
- mysqli_stmt
|
||||
- Exception
|
||||
- MDGenericWriter
|
||||
- MDGenericObject
|
||||
- XMLParser
|
||||
- LidoParser
|
||||
- MDValueSet
|
||||
- MDMysqliInvalidInput
|
||||
- MDMysqliExpectedError
|
||||
- MDgenericInvalidInputsException
|
||||
- MDExpectedException
|
||||
|
||||
parametersSchema:
|
||||
ergebnis: structure([
|
||||
allowAbstractClasses: bool()
|
||||
classesAllowedToBeExtended: listOf(string())
|
||||
classesNotRequiredToBeAbstractOrFinal: listOf(string())
|
||||
interfacesImplementedByContainers: listOf(string())
|
||||
])
|
||||
|
||||
rules:
|
||||
- PHPStan\Rules\BooleansInConditions\BooleanInBooleanAndRule
|
||||
- PHPStan\Rules\BooleansInConditions\BooleanInBooleanOrRule
|
||||
- PHPStan\Rules\BooleansInConditions\BooleanInElseIfConditionRule
|
||||
- PHPStan\Rules\BooleansInConditions\BooleanInTernaryOperatorRule
|
||||
- PHPStan\Rules\DisallowedConstructs\DisallowedImplicitArrayCreationRule
|
||||
- PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule
|
||||
- PHPStan\Rules\ForeachLoop\OverwriteVariablesWithForeachRule
|
||||
- PHPStan\Rules\Methods\WrongCaseOfInheritedMethodRule
|
||||
- PHPStan\Rules\Operators\OperandInArithmeticPostDecrementRule
|
||||
- PHPStan\Rules\Operators\OperandInArithmeticPostIncrementRule
|
||||
- PHPStan\Rules\Operators\OperandInArithmeticPreDecrementRule
|
||||
- PHPStan\Rules\Operators\OperandInArithmeticPreIncrementRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticAdditionRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticDivisionRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticExponentiationRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticModuloRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticMultiplicationRule
|
||||
- PHPStan\Rules\Operators\OperandsInArithmeticSubtractionRule
|
||||
- PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule
|
||||
- PHPStan\Rules\StrictCalls\StrictFunctionCallsRule
|
||||
- PHPStan\Rules\SwitchConditions\MatchingTypeInSwitchCaseConditionRule
|
||||
- PHPStan\Rules\VariableVariables\VariableMethodCallRule
|
||||
- PHPStan\Rules\VariableVariables\VariableStaticMethodCallRule
|
||||
- PHPStan\Rules\VariableVariables\VariableStaticPropertyFetchRule
|
||||
- PHPStan\Rules\VariableVariables\VariableVariablesRule
|
||||
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
|
||||
- Ergebnis\PHPStan\Rules\Expressions\NoErrorSuppressionRule
|
||||
- Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
|
||||
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
|
||||
- Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
|
||||
- Ergebnis\PHPStan\Rules\Methods\FinalInAbstractClassRule
|
||||
- Ergebnis\PHPStan\Rules\Methods\NoNullableReturnTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule
|
||||
- Ergebnis\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule
|
||||
- Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
|
||||
|
||||
services:
|
||||
-
|
||||
class: PHPStan\Rules\BooleansInConditions\BooleanRuleHelper
|
||||
|
||||
-
|
||||
class: PHPStan\Rules\Operators\OperatorRuleHelper
|
||||
-
|
||||
class: PHPStan\Rules\VariableVariables\VariablePropertyFetchRule
|
||||
arguments:
|
||||
universalObjectCratesClasses: %universalObjectCratesClasses%
|
||||
tags:
|
||||
- phpstan.rules.rule
|
||||
-
|
||||
class: Ergebnis\PHPStan\Rules\Classes\FinalRule
|
||||
arguments:
|
||||
allowAbstractClasses: %ergebnis.allowAbstractClasses%
|
||||
classesNotRequiredToBeAbstractOrFinal: %ergebnis.classesNotRequiredToBeAbstractOrFinal%
|
||||
tags:
|
||||
- phpstan.rules.rule
|
||||
|
||||
-
|
||||
class: Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
|
||||
arguments:
|
||||
classesAllowedToBeExtended: %ergebnis.classesAllowedToBeExtended%
|
||||
tags:
|
||||
- phpstan.rules.rule
|
||||
|
||||
-
|
||||
class: Ergebnis\PHPStan\Rules\Classes\PHPUnit\Framework\TestCaseWithSuffixRule
|
||||
tags:
|
||||
- phpstan.rules.rule
|
||||
|
||||
-
|
||||
class: Ergebnis\PHPStan\Rules\Methods\NoParameterWithContainerTypeDeclarationRule
|
||||
arguments:
|
||||
interfacesImplementedByContainers: %ergebnis.interfacesImplementedByContainers%
|
||||
tags:
|
||||
- phpstan.rules.rule
|
Loading…
Reference in New Issue
Block a user