Skip to content

Commit

Permalink
[TASK] Allow instanceOf checks in a test in a different way
Browse files Browse the repository at this point in the history
This removes one obstacle for upgrading to PHPStan 2.

Fixes #737
  • Loading branch information
oliverklee committed Dec 25, 2024
1 parent 8e2fb9b commit 0201751
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ parameters:
- Configuration
- Tests

# Allow instanceof checks, particularly in tests
checkAlwaysTrueCheckTypeFunctionCall: false

# Stricter checks
checkBenevolentUnionTypes: true
checkImplicitMixed: true
Expand All @@ -28,3 +25,8 @@ parameters:
reportAlwaysTrueInLastCondition: true
reportAnyTypeWideningInVarTag: true
reportPossiblyNonexistentConstantArrayOffset: true

ignoreErrors:
-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#'
path: 'Tests/'

0 comments on commit 0201751

Please sign in to comment.