diff --git a/composer.json b/composer.json index 50d99ce..8469e26 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "phpstan/phpstan-nette": "1.1.0", "nepada/phpstan-nette-tester": "1.0.0", "spaze/phpstan-disallowed-calls": "2.10.0", - "shipmonk/phpstan-rules": "1.2.0", + "shipmonk/phpstan-rules": "2.0.1", "php-parallel-lint/php-parallel-lint": "1.3.2", "nepada/coding-standard": "7.6.0" }, diff --git a/tests/PHPStan/shipmonk.neon b/tests/PHPStan/shipmonk.neon index 0678b89..52e8128 100644 --- a/tests/PHPStan/shipmonk.neon +++ b/tests/PHPStan/shipmonk.neon @@ -1,23 +1,53 @@ -rules: - - ShipMonk\PHPStan\Rule\BackedEnumGenericsRule - - ShipMonk\PHPStan\Rule\ForbidAssignmentNotMatchingVarDocRule - - ShipMonk\PHPStan\Rule\ForbidEnumInFunctionArgumentsRule - - ShipMonk\PHPStan\Rule\ForbidFetchOnMixedRule - - ShipMonk\PHPStan\Rule\ForbidMatchDefaultArmForEnumsRule - - ShipMonk\PHPStan\Rule\ForbidMethodCallOnMixedRule - - ShipMonk\PHPStan\Rule\ForbidReturnInConstructorRule - - ShipMonk\PHPStan\Rule\ForbidUnsetClassFieldRule - - ShipMonk\PHPStan\Rule\ForbidUnusedExceptionRule - - ShipMonk\PHPStan\Rule\ForbidUnusedMatchResultRule - - ShipMonk\PHPStan\Rule\ForbidVariableTypeOverwritingRule - - ShipMonk\PHPStan\Rule\RequirePreviousExceptionPassRule +includes: + - ../../vendor/shipmonk/phpstan-rules/rules.neon -services: - - - type: ShipMonk\PHPStan\Visitor\UnusedExceptionVisitor - tags: - - phpstan.parser.richParserNodeVisitor - - - class: ShipMonk\PHPStan\Visitor\UnusedMatchVisitor - tags: - - phpstan.parser.richParserNodeVisitor +parameters: + shipmonkRules: + allowComparingOnlyComparableTypes: + enabled: false + allowNamedArgumentOnlyInAttributes: + enabled: false + backedEnumGenerics: + enabled: true + enforceReadonlyPublicProperty: + enabled: false + forbidAssignmentNotMatchingVarDoc: + enabled: true + forbidCustomFunctions: + enabled: false + list: [] + forbidEnumInFunctionArguments: + enabled: true + forbidFetchOnMixed: + enabled: true + forbidMatchDefaultArmForEnums: + enabled: true + forbidMethodCallOnMixed: + enabled: true + forbidNullInAssignOperations: + enabled: true + blacklist: ['??='] + forbidNullInBinaryOperations: + enabled: true + blacklist: [ + '**', '!=', '==', '+', 'and', 'or', '&&', '||', '%', '-', '/', '*', # checked by phpstan-strict-rules + '>', '>=', '<', '<=', '<=>', # allow comparisons + '===', '!==', '??' # valid + ] + forbidVariableTypeOverwriting: + enabled: true + forbidUnsetClassField: + enabled: true + forbidUselessNullableReturn: + enabled: false + forbidUnusedException: + enabled: true + forbidUnusedMatchResult: + enabled: true + requirePreviousExceptionPass: + enabled: true + reportEvenIfExceptionIsNotAcceptableByRethrownOne: false + uselessPrivatePropertyDefaultValue: + enabled: true + uselessPrivatePropertyNullability: + enabled: true