| Total Complexity | 7 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 81.25% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class AuthorizationList |
||
| 8 | { |
||
| 9 | public const KM_ORIGIN_GENERATED = 0; |
||
| 10 | |||
| 11 | public const KM_PURPOSE_SIGN = 2; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var int[] |
||
| 15 | */ |
||
| 16 | private $purposeList = []; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var bool |
||
| 20 | */ |
||
| 21 | private $allApplications = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int|null |
||
| 25 | */ |
||
| 26 | private $origin; |
||
| 27 | |||
| 28 | 2 | public function hasPurpose(int $purpose): bool |
|
| 29 | { |
||
| 30 | 2 | return in_array($purpose, $this->purposeList, true); |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return int[] |
||
| 35 | */ |
||
| 36 | 1 | public function getPurposeList(): array |
|
| 37 | { |
||
| 38 | 1 | return $this->purposeList; |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | public function addPurpose(int $purpose): void |
|
| 42 | { |
||
| 43 | 2 | $this->purposeList[] = $purpose; |
|
| 44 | 2 | } |
|
| 45 | |||
| 46 | 2 | public function hasAllApplications(): bool |
|
| 47 | { |
||
| 48 | 2 | return $this->allApplications; |
|
| 49 | } |
||
| 50 | |||
| 51 | public function setAllApplications(bool $allApplications): void |
||
| 52 | { |
||
| 53 | $this->allApplications = $allApplications; |
||
| 54 | } |
||
| 55 | |||
| 56 | 2 | public function getOrigin(): ?int |
|
| 57 | { |
||
| 58 | 2 | return $this->origin; |
|
| 59 | } |
||
| 60 | |||
| 61 | 2 | public function setOrigin(?int $origin): void |
|
| 64 | 2 | } |
|
| 65 | } |
||
| 66 |