Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
13 | 1 | protected function generateInsecureIv(int $length): string |
|
14 | { |
||
15 | 1 | $permitted_chars = implode( |
|
16 | 1 | '', |
|
17 | array_merge( // @codeCoverageIgnore |
||
18 | 1 | range('A', 'z'), |
|
19 | 1 | range(0, 9), |
|
20 | 1 | str_split('~!@#$%&*()-=+{};:"<>,.?/\'') |
|
21 | ) |
||
22 | ); |
||
23 | 1 | $random = ''; |
|
24 | 1 | for ($i = 0; $i < $length; $i++) { |
|
25 | 1 | $random .= $permitted_chars[mt_rand(0, ($length) - 1)]; |
|
26 | } |
||
27 | 1 | return $random; |
|
28 | } |
||
29 | |||
48 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.