Skip to content

Commit

Permalink
Enable new shipmonk phpstan rules
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Oct 23, 2022
1 parent 0277f37 commit b552c52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions phpstan.neon.dist
Expand Up @@ -37,3 +37,11 @@ parameters:
message: "#^Parameter \\#1 \\$s of static method Nette\\\\Utils\\\\Strings\\:\\:trim\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/PhoneNumberInput/PhoneNumberInput.php
- # conditional type narrowing
message: "#^Overwriting variable \\$value while changing its type from string to Brick\\\\PhoneNumber\\\\PhoneNumber$#"
count: 1
path: src/PhoneNumberInput/PhoneNumberInput.php
- # conditional type narrowing
message: "#^Overwriting variable \\$value while changing its type from int to string$#"
count: 1
path: src/PhoneNumberInput/Validator.php
9 changes: 9 additions & 0 deletions tests/PHPStan/shipmonk.neon
@@ -1,14 +1,23 @@
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

services:
-
type: ShipMonk\PHPStan\Visitor\UnusedExceptionVisitor
tags:
- phpstan.parser.richParserNodeVisitor
-
class: ShipMonk\PHPStan\Visitor\UnusedMatchVisitor
tags:
- phpstan.parser.richParserNodeVisitor

0 comments on commit b552c52

Please sign in to comment.