-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon
More file actions
39 lines (29 loc) · 1.75 KB
/
Copy pathphpstan.neon
File metadata and controls
39 lines (29 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
parameters:
# Level 7 is industry standard for packages (Laravel, Symfony, etc.)
level: 7
paths:
- src
- tests
# Check PHP version compatibility
phpVersion: 80200
# Additional checks (reasonable for packages)
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: true
# Ignore specific patterns that are acceptable in packages
ignoreErrors:
# Allow isset on non-nullable offsets in tests (common pattern)
- '#Offset .* on array.* in isset\(\) always exists and is not nullable#'
# Collection offsetGet can return null when offset doesn't exist (ArrayAccess contract)
- '#Method .+Collection::offsetGet\(\) should return .+ but returns .+\|null#'
# Test data properties don't need full type specification
- '#Property .+Test::\$testData type has no value type specified#'
# Allow Collection generics in tests (PHPUnit limitation)
- '#Parameter .+ of method .+Assert::assertCount\(\) expects .+, .+Collection<mixed>\|null given#'
# Resource caching returns AbstractResource but methods return specific types (intentional)
- '#Method Recharge\\RechargeClient::(customers|subscriptions|orders|charges|addresses|products|store)\(\) should return .+ but returns .+AbstractResource#'
# Enum value comparisons are always true/false based on enum cases (intentional - helper methods for convenience)
- '#Comparison operation .+ between .+ and (200|300|400|500|600) is always (true|false)\.#'
- '#Comparison operation .+ between (200|400|500).+ and (300|500|600) is always (true|false)\.#'
# Exclude patterns
excludePaths:
- tests/bootstrap.php