File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 21
21
22
22
class DataValidationRulesResolver
23
23
{
24
-
25
24
protected array $ collectionRulesCache = [];
26
25
27
26
public function __construct (
@@ -198,16 +197,16 @@ protected function resolveDataCollectionSpecificRules(
198
197
DataRules $ dataRules ,
199
198
): void {
200
199
$ this ->resolveToplevelRules (
201
- $ dataProperty ,
202
- $ fullPayload ,
203
- $ path ,
204
- $ propertyPath ,
205
- $ dataRules ,
206
- shouldBePresent: true
200
+ $ dataProperty ,
201
+ $ fullPayload ,
202
+ $ path ,
203
+ $ propertyPath ,
204
+ $ dataRules ,
205
+ shouldBePresent: true
207
206
);
208
207
209
208
// If collection payload is null or not an array, no nested rules needed
210
- if (!is_array ($ collectionPayload )) {
209
+ if (! is_array ($ collectionPayload )) {
211
210
return ;
212
211
}
213
212
@@ -216,16 +215,17 @@ protected function resolveDataCollectionSpecificRules(
216
215
217
216
// Optimization: If nested class has NO dynamic rules method, build flat array
218
217
if (! $ hasDynamicRules ) {
219
- // Generate rules per item but add directly
218
+ // Generate rules per item but add directly
220
219
foreach ($ collectionPayload as $ collectionItemKey => $ collectionItemValue ) {
221
220
$ itemPath = $ propertyPath ->property ($ collectionItemKey );
222
221
223
- if (!is_array ($ collectionItemValue )) {
222
+ if (! is_array ($ collectionItemValue )) {
224
223
$ dataRules ->add ($ itemPath , ['array ' ]);
224
+
225
225
continue ;
226
226
}
227
227
228
- // Directly execute rule generation for this specific item and path
228
+ // Directly execute rule generation for this specific item and path
229
229
$ this ->execute (
230
230
$ nestedDataClass ->name ,
231
231
$ fullPayload ,
You can’t perform that action at this time.
0 commit comments