| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 69.23% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ContredanseUser implements UserInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $identity; |
||
| 15 | /** |
||
| 16 | * @var array|string[] |
||
| 17 | */ |
||
| 18 | private $details; |
||
| 19 | /** |
||
| 20 | * @var array|string[] |
||
| 21 | */ |
||
| 22 | private $roles; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param string[] $roles |
||
| 26 | * @param string[] $details |
||
| 27 | */ |
||
| 28 | 8 | public function __construct(string $identity, array $roles = [], array $details = []) |
|
| 29 | { |
||
| 30 | 8 | $this->identity = $identity; |
|
| 31 | 8 | $this->details = $details; |
|
| 32 | 8 | $this->roles = $roles; |
|
| 33 | 8 | } |
|
| 34 | |||
| 35 | public function getIdentity(): string |
||
| 36 | { |
||
| 37 | return $this->identity; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return string[] |
||
| 42 | */ |
||
| 43 | 8 | public function getRoles(): array |
|
| 44 | { |
||
| 45 | 8 | return $this->roles; |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param mixed $default |
||
| 50 | * |
||
| 51 | * @return mixed|null|string |
||
| 52 | */ |
||
| 53 | 8 | public function getDetail(string $name, $default = null) |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get all additional user details, if any. |
||
| 60 | */ |
||
| 61 | public function getDetails(): array |
||
| 64 | } |
||
| 65 | } |
||
| 66 |