Code Duplication    Length = 14-16 lines in 2 locations

src/Validation/Validator.php 2 locations

@@ 203-216 (lines=14) @@
200
                    }
201
202
                    break;
203
                case 'min':
204
                    if (!is_numeric($ruleContents)) {
205
                        throw new \InvalidArgumentException("Invalid min validation rule[{$ruleContents}]");
206
                    }
207
208
                    if ($value < $ruleContents) {
209
                        $fieldName =
210
                        $errorMsg = $this->translator->trans(
211
                            'errorFieldMustBeMinNumber',
212
                            ['%field%' => $fieldName, '%number%' => $ruleContents]
213
                        );
214
                    }
215
216
                    break;
217
                case 'max':
218
                    if (!is_numeric($ruleContents)) {
219
                        throw new \InvalidArgumentException("Invalid max validation rule[{$ruleContents}]");
@@ 217-232 (lines=16) @@
214
                    }
215
216
                    break;
217
                case 'max':
218
                    if (!is_numeric($ruleContents)) {
219
                        throw new \InvalidArgumentException("Invalid max validation rule[{$ruleContents}]");
220
                    }
221
222
                    if ($value > $ruleContents) {
223
                        $errorMsg = $this->translator->trans(
224
                            'errorFieldMustBeMaxNumber',
225
                            [
226
                                '%field%'  => $fieldName,
227
                                '%number%' => $ruleContents
228
                            ]
229
                        );
230
                    }
231
232
                    break;
233
                case 'minLength':
234
                    if (!is_int($ruleContents) || $ruleContents < 1) {
235
                        throw new \InvalidArgumentException("Invalid min length validation rule[{$ruleContents}]");