@@ -96,7 +96,7 @@ protected function __construct(array $config, array $path)
96
96
*/
97
97
protected function _validate (array $ arg , mixed $ value , array &$ res , array $ settings ): void
98
98
{
99
- $ this ->_validateListOfType ($ arg , $ value , $ res , [0 ]);
99
+ $ this ->_validateListOfType ($ arg , $ value , $ res , [0 ], $ settings );
100
100
}
101
101
102
102
protected function _leafName (array $ config ): string
@@ -109,8 +109,9 @@ protected function _leafName(array $config): string
109
109
* @param mixed[] $value
110
110
* @param array<mixed> $res
111
111
* @param Array<string|int> $path
112
+ * @param ValidationSettings $settings
112
113
*/
113
- protected function _validateListOfType (array $ config , array $ value , array &$ res , array $ path ): void
114
+ protected function _validateListOfType (array $ config , array $ value , array &$ res , array $ path, array $ settings ): void
114
115
{
115
116
$ validate = $ this ->config [static ::ITEMS_NAME ]['validate ' ] ?? null ;
116
117
$ wrappedType = $ config ['type ' ]->getWrappedType ();
@@ -125,15 +126,15 @@ protected function _validateListOfType(array $config, array $value, array &$res,
125
126
// If the wrapped type is a list, recursively validate each item
126
127
if ($ wrappedType instanceof ListOfType) {
127
128
$ newPath = [...$ path , 0 ]; // Append 0 for list path
128
- $ this ->_validateListOfType (['type ' => $ wrappedType , 'validate ' => $ validate ], $ subValue , $ res , $ newPath );
129
+ $ this ->_validateListOfType (['type ' => $ wrappedType , 'validate ' => $ validate ], $ subValue , $ res , $ newPath, $ settings );
129
130
continue ; // Skip to the next iteration
130
131
}
131
132
132
133
// Validate scalar or complex types
133
134
if (static ::isScalarType ($ wrappedType )) {
134
135
$ err = static ::_formatValidationResult ($ validate ($ subValue ));
135
136
} else {
136
- $ err = $ wrappedErrorType ->validate (['type ' => $ wrappedType ], $ subValue );
137
+ $ err = $ wrappedErrorType ->validate (['type ' => $ wrappedType ], $ subValue, $ settings );
137
138
}
138
139
139
140
// Check for errors and add to results if necessary
0 commit comments