| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function isStringBetweenValid($value, int $minLength, int $maxLength, $encoding = 'utf8'): bool |
||
| 21 | { |
||
| 22 | if (false ===is_string($value)) { |
||
| 23 | return false; |
||
| 24 | } |
||
| 25 | |||
| 26 | $length = mb_strlen($value, $encoding); |
||
| 27 | if ($length < $minLength) { |
||
| 28 | return false; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($length > $maxLength) { |
||
|
|
|||
| 32 | return false; |
||
| 33 | } |
||
| 34 | |||
| 35 | return true; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |