| Conditions | 7 |
| Paths | 8 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 97 | public function isValid($value) { |
||
| 98 | |||
| 99 | if ($this->exactLen !== null and mb_strlen($value, 'UTF-8') != $this->exactLen) { |
||
| 100 | $this->addError(vsprintf($this->exactLenError, [$this->exactLen])); |
||
| 101 | } |
||
| 102 | |||
| 103 | if ($this->maxLen !== null and mb_strlen($value, 'UTF-8') > $this->maxLen) { |
||
| 104 | $this->addError(vsprintf($this->maxLenError, [$this->maxLen])); |
||
| 105 | } |
||
| 106 | |||
| 107 | if ($this->minLen !== null and mb_strlen($value, 'UTF-8') < $this->minLen) { |
||
| 108 | $this->addError(vsprintf($this->minLenError, [$this->minLen])); |
||
| 109 | } |
||
| 110 | |||
| 111 | return !$this->hasErrors(); |
||
| 112 | } |
||
| 113 | |||
| 114 | } |