-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphpstan.neon
More file actions
122 lines (113 loc) · 5.21 KB
/
Copy pathphpstan.neon
File metadata and controls
122 lines (113 loc) · 5.21 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
parameters:
level: 6
paths:
- packages/Api/src
- packages/Bucketing/src
- packages/Data/src
- packages/Enums/src
- packages/Event/src
- packages/Experience/src
- packages/Logger/src
- packages/Php-sdk/src
- packages/Rules/src
- packages/Segments/src
- packages/Utils/src
excludePaths:
- packages/Types/lib
scanDirectories:
- packages/Types/lib
reportUnmatchedIgnoredErrors: false
ignoreErrors:
# ---------------------------------------------------------------
# OpenAPI model namespace mismatch
# Types package declares "OpenApi\Client" but autoloader maps "OpenAPI\Client".
# Generated files cannot be modified.
# ---------------------------------------------------------------
- identifier: class.nameCase
# ---------------------------------------------------------------
# OpenAPI models implement ArrayAccess but PHPStan doesn't track
# dynamic offsets. At runtime, models are often hydrated from raw
# arrays and accessed via bracket notation (JS SDK parity).
# ---------------------------------------------------------------
- identifier: offsetAccess.notFound
- identifier: offsetAssign.dimType
- identifier: isset.offset
- identifier: empty.offset
# ---------------------------------------------------------------
# PHPDoc type gaps — SDK ported from JS, many array returns lack
# value-type annotations. Fixing incrementally; suppress globally
# until full PHPDoc coverage is achieved.
# ---------------------------------------------------------------
- identifier: missingType.iterableValue
- identifier: missingType.parameter
- identifier: missingType.generics
- identifier: return.phpDocType
- identifier: parameter.phpDocType
- identifier: phpDoc.parseError
# ---------------------------------------------------------------
# Defensive runtime checks
# PHPStan proves these are redundant at the type level, but they
# exist as runtime safety for data that arrives as untyped arrays
# from the API. Keeping them is intentional (JS SDK parity).
# ---------------------------------------------------------------
- identifier: nullsafe.neverNull
- identifier: function.alreadyNarrowedType
- identifier: function.impossibleType
- identifier: instanceof.alwaysTrue
- identifier: instanceof.alwaysFalse
- identifier: booleanAnd.alwaysFalse
- identifier: booleanAnd.leftAlwaysFalse
- identifier: booleanAnd.leftAlwaysTrue
- identifier: booleanOr.alwaysFalse
- identifier: booleanOr.alwaysTrue
- identifier: identical.alwaysFalse
- identifier: identical.alwaysTrue
- identifier: notIdentical.alwaysFalse
- identifier: ternary.alwaysTrue
- identifier: if.alwaysTrue
- identifier: greater.alwaysTrue
- identifier: empty.variable
# ---------------------------------------------------------------
# Properties / dead code
# Some properties are stored for future use or API compatibility.
# Some code paths are unreachable per PHPStan but kept for safety.
# ---------------------------------------------------------------
- identifier: property.onlyWritten
- identifier: property.unusedType
- identifier: property.nonObject
- identifier: deadCode.unreachable
- identifier: nullCoalesce.offset
- identifier: nullCoalesce.expr
- identifier: nullCoalesce.variable
- identifier: foreach.nonIterable
- identifier: foreach.emptyArray
- identifier: return.unusedType
- identifier: method.unused
# ---------------------------------------------------------------
# Scoped suppressions for known legacy issues
# These identifiers catch real bugs, so they are path-restricted
# rather than globally suppressed.
# ---------------------------------------------------------------
# RuleAnd/RuleOrWhen constructors expect typed params but receive
# ArrayAccess objects; get_class_methods called on array (custom interface)
-
identifier: argument.type
paths:
- packages/Rules/src/RuleManager.php
- packages/Php-sdk/src/Context.php
- packages/Data/src/DataManager.php
# PHPDoc references StoreData, GoalData, Entity from Types namespace
# that resolve under the wrong case (OpenApi vs OpenAPI)
-
identifier: class.notFound
paths:
- packages/Data/src/DataManager.php
- packages/Data/src/Interfaces/DataManagerInterface.php
# DataManager._mapper() — closure stored as property, invoked as method
-
identifier: method.notFound
path: packages/Data/src/DataManager.php
# FeatureManager.runFeatureById return type shape mismatch
-
identifier: return.type
path: packages/Php-sdk/src/FeatureManager.php