Code Duplication    Length = 8-8 lines in 2 locations

src/UI/Resolver/Validator/Implementation/Pure/DateValidatorTrait.php 1 location

@@ 56-63 (lines=8) @@
53
     *
54
     * @return \DateTime|null
55
     */
56
    public function mustBeDateTimeOrEmpty($value, string $propertyPath = null, UIValidatorInterface $parentValidator = null, string $exceptionMessage = null)
57
    {
58
        if (empty($value)) {
59
            return null;
60
        }
61
62
        return $this->mustBeDateTime($value, $propertyPath, $parentValidator, $exceptionMessage);
63
    }
64
65
    /**
66
     * Exceptions are caught in order to be processed later

src/UI/Resolver/Validator/Implementation/Pure/StringValidatorTrait.php 1 location

@@ 20-27 (lines=8) @@
17
     *
18
     * @return string|null Casted to string or null
19
     */
20
    public function mustBeStringOrEmpty($value, string $propertyPath = null, UIValidatorInterface $parentValidator = null, string $exceptionMessage = null)
21
    {
22
        if (empty($value)) {
23
            return null;
24
        }
25
26
        return $this->mustBeString($value, $propertyPath, $parentValidator, $exceptionMessage);
27
    }
28
29
    /**
30
     * Exceptions are caught in order to be processed later