Total Complexity | 2 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | trait IntTrait |
||
13 | { |
||
14 | /** @var string */ |
||
15 | private static string $int_regex = '/^ |
||
16 | ( |
||
17 | ( |
||
18 | ([-+]?[0]*) |
||
19 | (?: |
||
20 | [1-9] |
||
21 | |214748364[0-7] |
||
22 | |[1-9][0-9] |
||
23 | |[1-9][0-9][0-9] |
||
24 | |[1-9][0-9][0-9][0-9] |
||
25 | |[1-9][0-9][0-9][0-9][0-9] |
||
26 | |[1-9][0-9][0-9][0-9][0-9][0-9] |
||
27 | |[1-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
28 | |[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
29 | |[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
30 | |1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
31 | |20[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
32 | |21[0-3][0-9][0-9][0-9][0-9][0-9][0-9][0-9] |
||
33 | |214[0-6][0-9][0-9][0-9][0-9][0-9][0-9] |
||
34 | |2147[0-3][0-9][0-9][0-9][0-9][0-9] |
||
35 | |21474[0-7][0-9][0-9][0-9][0-9] |
||
36 | |214748[0-2][0-9][0-9][0-9] |
||
37 | |2147483[0-5][0-9][0-9] |
||
38 | |21474836[0-3][0-9] |
||
39 | |[0-9] |
||
40 | |214748364[0-7] |
||
41 | ) |
||
42 | )| |
||
43 | 0| |
||
44 | ((-([0]*)?)2147483648) |
||
45 | ) |
||
46 | $/Dx'; |
||
47 | |||
48 | /** |
||
49 | * @param string $value |
||
50 | * @param string $message |
||
51 | */ |
||
52 | protected static function validInt(string $value, string $message = ''): void |
||
62 |