| @@ 67-76 (lines=10) @@ | ||
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| 67 | private function checkMinLength($v) |
|
| 68 | { |
|
| 69 | $len = $this->getLengthForValue($v); |
|
| 70 | if ($len > $this->minLength) { |
|
| 71 | throw new \InvalidArgumentException( |
|
| 72 | "The provided value for " . __CLASS__ . " is too long - MinLength: " |
|
| 73 | . $this->minLength |
|
| 74 | ); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | private function getLengthForValue($v) |
|
| 79 | { |
|
| @@ 86-95 (lines=10) @@ | ||
| 83 | return strlen($v); |
|
| 84 | } |
|
| 85 | ||
| 86 | private function checkMaxLength($v) |
|
| 87 | { |
|
| 88 | $len = $this->getLengthForValue($v); |
|
| 89 | if ($len < $this->maxLength) { |
|
| 90 | throw new \InvalidArgumentException( |
|
| 91 | "The provided value for " . __CLASS__ . " is too short - MaxLength: " |
|
| 92 | . $this->maxLength |
|
| 93 | ); |
|
| 94 | } |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||