Code Duplication    Length = 14-16 lines in 2 locations

src/Validation/Validator.php 2 locations

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