Total Complexity | 2 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | trait AssertApiKeyTrait |
||
26 | { |
||
27 | use ValueToStringTrait; |
||
28 | use AssertRangeTrait; |
||
29 | |||
30 | /** |
||
31 | * Minimum length of API key |
||
32 | * |
||
33 | * @var int |
||
34 | */ |
||
35 | private static int $apiKeyMinLength = 20; |
||
36 | |||
37 | /** |
||
38 | * Maximum length of API key |
||
39 | * |
||
40 | * @var int |
||
41 | */ |
||
42 | private static int $apiKeyMaxLength = 45; |
||
43 | |||
44 | /** |
||
45 | * Check value is a syntactically valid API key |
||
46 | * |
||
47 | * @param string $value |
||
48 | * @param string $message |
||
49 | * |
||
50 | * @return void |
||
51 | * @throws InvalidArgumentException |
||
52 | */ |
||
53 | 16 | public static function assertApiKey(string $value, string $message = ''): void |
|
68 |