Total Complexity | 5 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 28.57% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class Permission implements \JsonSerializable |
||
20 | { |
||
21 | use JsonSerializableTrait; |
||
22 | |||
23 | /** @var string Permission label. */ |
||
24 | private $label; |
||
25 | |||
26 | /** @var GoogleImage */ |
||
27 | private $icon; |
||
28 | |||
29 | /** @var string[] Permissions. */ |
||
30 | private $permissions; |
||
31 | |||
32 | /** |
||
33 | * Permission constructor. |
||
34 | * |
||
35 | * @param string $label |
||
36 | * @param GoogleImage $icon |
||
37 | * @param string[] $permissions |
||
38 | */ |
||
39 | 1 | public function __construct(string $label, GoogleImage $icon, array $permissions) |
|
40 | { |
||
41 | 1 | $this->label = $label; |
|
42 | 1 | $this->icon = $icon; |
|
43 | 1 | $this->permissions = $permissions; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getLabel(): string |
||
50 | { |
||
51 | return $this->label; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return GoogleImage |
||
56 | */ |
||
57 | public function getIcon(): GoogleImage |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string[] |
||
64 | */ |
||
65 | public function getPermissions(): array |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * Returns class properties as an array. |
||
72 | * |
||
73 | * @return array class properties as an array |
||
74 | */ |
||
75 | public function asArray(): array |
||
84 |