1 | <?php |
||
11 | class Entropic |
||
12 | { |
||
13 | /** |
||
14 | * Printable ASCII characters |
||
15 | */ |
||
16 | |||
17 | private const ASCII_SYMBOL = "!\\\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"; |
||
18 | |||
19 | private const ASCII_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
||
20 | |||
21 | private const ASCII_LOWERCASE = "abcdefghijklmnopqrstuvwxyz"; |
||
22 | |||
23 | private const ASCII_NUMERICAL = "0123456789"; |
||
24 | |||
25 | private const DEFAULT_CHARSET = self::ASCII_SYMBOL.self::ASCII_LOWERCASE.self::ASCII_UPPERCASE.self::ASCII_NUMERICAL; |
||
26 | |||
27 | /** |
||
28 | * @param $length |
||
29 | * |
||
30 | * @return string |
||
31 | * @throws Exception |
||
32 | */ |
||
33 | public function genPassword(int $length): string |
||
43 | |||
44 | /** |
||
45 | * @return int|null |
||
46 | * Working on CLI |
||
47 | */ |
||
48 | private function getOps(): ?int |
||
56 | |||
57 | /** |
||
58 | * @param int $length |
||
59 | * |
||
60 | * @return string |
||
61 | * @throws Exception |
||
62 | */ |
||
63 | private function generateRandomString(int $length): string |
||
78 | |||
79 | private function defaultCharset(): array |
||
83 | } |
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.