Total Complexity | 6 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | final class AuthorizationEntity implements AuthorizationEntityInterface |
||
9 | { |
||
10 | 16 | public function __construct( |
|
11 | private string $type, |
||
12 | private string $id, |
||
13 | private array $attributes = [] |
||
14 | ) { |
||
15 | 16 | if (empty(trim($type))) { |
|
16 | 2 | throw new InvalidArgumentException('Type of AuthorizationEntity cannot be empty.'); |
|
17 | } |
||
18 | 14 | if (empty(trim($id))) { |
|
19 | 2 | throw new InvalidArgumentException('ID of AuthorizationEntity cannot be empty.'); |
|
20 | } |
||
21 | } |
||
22 | |||
23 | 9 | public function getId(): string |
|
26 | } |
||
27 | |||
28 | 9 | public function getType(): string |
|
29 | { |
||
30 | 9 | return $this->type; |
|
31 | } |
||
32 | |||
33 | 1 | public function getAttributes(): array |
|
36 | } |
||
37 | } |
||
38 |