Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | class RequestMapper extends RestRequestMapper |
||
27 | { |
||
28 | /** |
||
29 | * @var array<int, non-empty-string> |
||
|
|||
30 | */ |
||
31 | protected static array $properties = [ |
||
32 | 'username', |
||
33 | 'firstName', |
||
34 | 'lastName', |
||
35 | 'email', |
||
36 | 'language', |
||
37 | 'locale', |
||
38 | 'timezone', |
||
39 | 'userGroups', |
||
40 | 'password', |
||
41 | ]; |
||
42 | |||
43 | 96 | public function __construct( |
|
46 | 96 | } |
|
47 | |||
48 | /** |
||
49 | * @param array<int, string> $userGroups |
||
50 | * |
||
51 | * @return array<int, UserGroup> |
||
52 | * |
||
53 | * @throws Throwable |
||
54 | */ |
||
55 | 4 | protected function transformUserGroups(array $userGroups): array |
|
60 | 4 | ); |
|
61 | } |
||
62 | |||
63 | 10 | protected function transformLanguage(string $language): Language |
|
64 | { |
||
65 | 10 | return Language::tryFrom($language) ?? throw new InvalidArgumentException('Invalid language'); |
|
66 | } |
||
67 | |||
68 | 3 | protected function transformLocale(string $locale): Locale |
|
71 | } |
||
72 | } |
||
73 |