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