Code Duplication    Length = 9-9 lines in 3 locations

src/Actions/Interactor/Form.php 1 location

@@ 340-348 (lines=9) @@
337
        $failedValidators = [];
338
339
        /** @var Field $field */
340
        foreach ($this->fields as $field) {
341
            if (!$validator = $field->getValidator($request->all())) {
342
                continue;
343
            }
344
345
            if (($validator instanceof Validator) && !$validator->passes()) {
346
                $failedValidators[] = $validator;
347
            }
348
        }
349
350
        $message = $this->mergeValidationMessages($failedValidators);
351

src/Widgets/Form.php 1 location

@@ 403-411 (lines=9) @@
400
        $failedValidators = [];
401
402
        /** @var Field $field */
403
        foreach ($this->fields() as $field) {
404
            if (!$validator = $field->getValidator($request->all())) {
405
                continue;
406
            }
407
408
            if (($validator instanceof Validator) && !$validator->passes()) {
409
                $failedValidators[] = $validator;
410
            }
411
        }
412
413
        $message = $this->mergeValidationMessages($failedValidators);
414

src/Form.php 1 location

@@ 1213-1221 (lines=9) @@
1210
        $failedValidators = [];
1211
1212
        /** @var Field $field */
1213
        foreach ($this->builder->fields() as $field) {
1214
            if (!$validator = $field->getValidator($input)) {
1215
                continue;
1216
            }
1217
1218
            if (($validator instanceof Validator) && !$validator->passes()) {
1219
                $failedValidators[] = $validator;
1220
            }
1221
        }
1222
1223
        $message = $this->mergeValidationMessages($failedValidators);
1224