Code Duplication    Length = 16-16 lines in 3 locations

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

@@ 18-33 (lines=16) @@
15
 * Trait SummaryValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait SummaryValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('correlativo', [
23
            new Assert\NotBlank(),
24
            new Assert\Length(['max' => 3]),
25
        ]);
26
        $metadata->addPropertyConstraint('fecGeneracion', new Assert\Date());
27
        $metadata->addPropertyConstraints('fecResumen', [
28
            new Assert\NotBlank(),
29
            new Assert\Date(),
30
        ]);
31
        $metadata->addPropertyConstraint('details', new Assert\Valid());
32
    }
33
}

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

@@ 18-33 (lines=16) @@
15
 * Trait VoidedValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait VoidedValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('correlativo', [
23
            new Assert\NotBlank(),
24
            new Assert\Length(['max' => 3]),
25
        ]);
26
        $metadata->addPropertyConstraint('fecGeneracion', new Assert\Date());
27
        $metadata->addPropertyConstraints('fecComunicacion', [
28
            new Assert\NotBlank(),
29
            new Assert\Date(),
30
        ]);
31
        $metadata->addPropertyConstraint('details', new Assert\Valid());
32
    }
33
}

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

@@ 18-33 (lines=16) @@
15
 * Trait SalePerceptionValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait SalePerceptionValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('codReg', [
23
            new Assert\NotBlank(),
24
            new Assert\Length([
25
                'min' => 2,
26
                'max' => 2,
27
            ]),
28
        ]);
29
        $metadata->addPropertyConstraint('mtoBase', new Assert\NotBlank());
30
        $metadata->addPropertyConstraint('mto', new Assert\NotBlank());
31
        $metadata->addPropertyConstraint('mtoTotal', new Assert\NotBlank());
32
    }
33
}