Total Complexity | 12 |
Total Lines | 106 |
Duplicated Lines | 0 % |
Coverage | 92% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class CasUser implements CasUserInterface |
||
13 | { |
||
14 | /** |
||
15 | * The user storage. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | private $storage; |
||
20 | |||
21 | /** |
||
22 | * CasUser constructor. |
||
23 | * |
||
24 | * @param array $data |
||
25 | */ |
||
26 | 12 | public function __construct(array $data) |
|
29 | 12 | } |
|
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function eraseCredentials(): void |
||
35 | { |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | 3 | public function get(string $key, $default = null) |
|
42 | { |
||
43 | 3 | return $this->getStorage()[$key] ?? $default; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 1 | public function getAttribute(string $key, $default = null) |
|
50 | { |
||
51 | 1 | return $this->getStorage()['attributes'][$key] ?? $default; |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 1 | public function getAttributes(): array |
|
58 | { |
||
59 | 1 | return $this->get('attributes', []); |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 1 | public function getPassword() |
|
66 | { |
||
67 | 1 | throw new LogicException('Not implemented.'); |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 1 | public function getPgt(): ?string |
|
74 | { |
||
75 | 1 | return $this->get('proxyGrantingTicket'); |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 1 | public function getRoles() |
|
82 | { |
||
83 | 1 | return ['ROLE_CAS_AUTHENTICATED']; |
|
84 | } |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 1 | public function getSalt() |
|
90 | { |
||
91 | 1 | throw new LogicException('Not implemented.'); |
|
92 | } |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 1 | public function getUser(): string |
|
100 | } |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | 1 | public function getUsername() |
|
106 | { |
||
107 | 1 | return $this->getUser(); |
|
108 | } |
||
109 | |||
110 | /** |
||
111 | * Get the storage. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | 4 | private function getStorage() |
|
118 | } |
||
119 | } |
||
120 |