Code Duplication    Length = 7-9 lines in 4 locations

src/CMPayments/SchemaValidator/SchemaValidator.php 4 locations

@@ 339-347 (lines=9) @@
336
            sprintf('caseSensitive|is_bool|%s', BaseValidator::BOOLEAN)
337
        ];
338
339
        if (isset($schema->type) && ($schema->type === BaseValidator::_ARRAY)) {
340
341
            // field|must_be|type_in_error_msg
342
            $input = array_merge($input, [
343
                sprintf('minItems|is_int|%s', BaseValidator::INTEGER),
344
                sprintf('maxItems|is_int|%s', BaseValidator::INTEGER),
345
                sprintf('uniqueItems|is_bool|%s', BaseValidator::BOOLEAN)
346
            ]);
347
        }
348
349
        if (isset($schema->type) && ($schema->type === BaseValidator::STRING)) {
350
@@ 349-356 (lines=8) @@
346
            ]);
347
        }
348
349
        if (isset($schema->type) && ($schema->type === BaseValidator::STRING)) {
350
351
            $input = array_merge($input, [
352
                sprintf('minLength|is_int|%s', BaseValidator::INTEGER),
353
                sprintf('maxLength|is_int|%s', BaseValidator::INTEGER),
354
                sprintf('format|is_string|%s', BaseValidator::STRING)
355
            ]);
356
        }
357
358
        if (isset($schema->type) && ($schema->type === BaseValidator::INTEGER)) {
359
@@ 358-364 (lines=7) @@
355
            ]);
356
        }
357
358
        if (isset($schema->type) && ($schema->type === BaseValidator::INTEGER)) {
359
360
            $input = array_merge($input, [
361
                sprintf('minimum|is_int|%s', BaseValidator::INTEGER),
362
                sprintf('maximum|is_int|%s', BaseValidator::INTEGER)
363
            ]);
364
        }
365
366
        if (isset($schema->type) && ($schema->type === BaseValidator::NUMBER)) {
367
@@ 366-372 (lines=7) @@
363
            ]);
364
        }
365
366
        if (isset($schema->type) && ($schema->type === BaseValidator::NUMBER)) {
367
368
            $input = array_merge($input, [
369
                sprintf('minimum|is_numeric|%s', BaseValidator::NUMBER),
370
                sprintf('maximum|is_numeric|%s', BaseValidator::NUMBER)
371
            ]);
372
        }
373
374
        return $this->validateSchemaProperties($input, $schema, $path);
375
    }