Conditions | 5 |
Paths | 7 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
15 | 8 | public static function string($string, array $options = []) |
|
16 | { |
||
17 | 8 | $options = array_merge([ |
|
18 | 8 | 'minlength' => 1, |
|
19 | 8 | 'maxlength' => false, |
|
20 | 8 | ], $options); |
|
21 | |||
22 | 8 | return !empty($string) && is_string($string) |
|
23 | 8 | && (strlen($string) >= $options['minlength']) |
|
24 | 8 | && (($options['maxlength'] == false) || (strlen($string) <= $options['maxlength'])); |
|
25 | } |
||
48 |