Code Duplication    Length = 10-10 lines in 2 locations

src/Facets/LengthTrait.php 2 locations

@@ 46-55 (lines=10) @@
43
        $this->maxLength = $value;
44
    }
45
46
    private function checkMaxLength($v)
47
    {
48
        $stringLen = strlen($v);
49
        if ($this->maxLength != null) {
50
            if ($stringLen < $this->maxLength) {
51
                throw new \InvalidArgumentException(
52
                    "the provided value for " . __CLASS__ . " is to short MaxLength: "
53
                    . $this->maxLength
54
                );
55
            }
56
        }
57
    }
58
@@ 59-68 (lines=10) @@
56
        }
57
    }
58
59
    private function checkMinLength($v)
60
    {
61
        $stringLen = strlen($v);
62
        if ($this->minLength != null) {
63
            if ($stringLen > $this->minLength) {
64
                throw new \InvalidArgumentException(
65
                    "the provided value for " . __CLASS__ . " is to long minLength: "
66
                    . $this->minLength
67
                );
68
            }
69
        }
70
    }
71
}