Code Duplication    Length = 25-28 lines in 2 locations

src/Greenter/Xml/Validator/SummaryDetailValidator.php 1 location

@@ 18-42 (lines=25) @@
15
 * Trait SummaryDetailValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait SummaryDetailValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('tipoDoc', [
23
            new Assert\NotBlank(),
24
            new Assert\Length([
25
                'min' => 2,
26
                'max' => 2,
27
            ]),
28
        ]);
29
        $metadata->addPropertyConstraints('serie', [
30
            new Assert\NotBlank(),
31
            new Assert\Length([ 'max' => 4]),
32
        ]);
33
        $metadata->addPropertyConstraints('correlativo', [
34
            new Assert\NotBlank(),
35
            new Assert\Length(['max' => 8]),
36
        ]);
37
        $metadata->addPropertyConstraints('desMotivoBaja', [
38
            new Assert\NotBlank(),
39
            new Assert\Length(['max' => 100]),
40
        ]);
41
    }
42
}

src/Greenter/Xml/Validator/VoidedDetailValidator.php 1 location

@@ 18-45 (lines=28) @@
15
 * Trait VoidedDetailValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait VoidedDetailValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('tipoDoc', [
23
            new Assert\NotBlank(),
24
            new Assert\Length([
25
                'min' => 2,
26
                'max' => 2,
27
            ]),
28
        ]);
29
        $metadata->addPropertyConstraints('serie', [
30
            new Assert\NotBlank(),
31
            new Assert\Length([
32
                'min' => 4,
33
                'max' => 4,
34
            ]),
35
        ]);
36
        $metadata->addPropertyConstraints('correlativo', [
37
            new Assert\NotBlank(),
38
            new Assert\Length(['max' => 8]),
39
        ]);
40
        $metadata->addPropertyConstraints('desMotivoBaja', [
41
            new Assert\NotBlank(),
42
            new Assert\Length(['max' => 100]),
43
        ]);
44
    }
45
}