Skip to content

Commit cc91dc8

Browse files
committed
Enhance configuration to include array validation strategy and stub file support
1 parent f773880 commit cc91dc8

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

src/Command/ConfigInitCommand.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ private static function getTemplate(): string
8585
*/
8686
'respect_ignore_tags' => true,
8787
88+
/*
89+
|--------------------------------------------------------------------------
90+
| Array Validation Strategy
91+
|--------------------------------------------------------------------------
92+
| Controls how collections (list<T>, array<K, V>, Type[]) are verified:
93+
|
94+
| - 'full' : (Default / Strict) 100% exhaustive scan. Checks every single
95+
| item in every array, guaranteeing every single offending item
96+
| is caught without exception.
97+
|
98+
| - 'hybrid' : (Beartype O(1) Mode) Fast boundary + random sampling on
99+
| arrays > 64 items. Ideal for massive production datasets.
100+
*/
101+
'array_validation' => 'full',
102+
88103
/*
89104
|--------------------------------------------------------------------------
90105
| Enable Caching & Cache Directory
@@ -112,18 +127,14 @@ private static function getTemplate(): string
112127
113128
/*
114129
|--------------------------------------------------------------------------
115-
| Array Validation Strategy
130+
| Stub Files (DocBlock Overrides for Third-Party & Vendor Packages)
116131
|--------------------------------------------------------------------------
117-
| Controls how collections (list<T>, array<K, V>, Type[]) are verified:
118-
|
119-
| - 'full' : (Default / Strict) 100% exhaustive scan. Checks every single
120-
| item in every array, guaranteeing every single offending item
121-
| is caught without exception.
122-
|
123-
| - 'hybrid' : (Beartype O(1) Mode) Fast boundary + random sampling on
124-
| arrays > 64 items. Ideal for massive production datasets.
132+
| Path globs or specific file paths containing stub files (.stub, .stub.php, .php)
133+
| that override inaccurate or missing DocBlocks in third-party vendor packages.
125134
*/
126-
'array_validation' => 'full',
135+
'stubs' => [
136+
// 'stubs/**',
137+
],
127138
128139
/*
129140
|--------------------------------------------------------------------------
@@ -186,4 +197,4 @@ private static function getTemplate(): string
186197
];
187198
PHP;
188199
}
189-
}
200+
}

0 commit comments

Comments
 (0)