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