Total Complexity | 14 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Groups implements Interfaces\IWorkGroups |
||
15 | { |
||
16 | /** @var Interfaces\IGroup[] */ |
||
17 | protected $local = []; |
||
18 | |||
19 | /** |
||
20 | * @param Interfaces\IGroup[] $initial |
||
21 | */ |
||
22 | 6 | public function __construct(array $initial = []) |
|
23 | { |
||
24 | 6 | $this->local = $initial; |
|
25 | 6 | } |
|
26 | |||
27 | 2 | public function createGroup(Interfaces\IGroup $group): bool |
|
37 | } |
||
38 | |||
39 | 2 | public function getGroupDataOnly(string $groupId): ?Interfaces\IGroup |
|
40 | { |
||
41 | 2 | foreach ($this->local as $local) { |
|
42 | 1 | if ($local->getGroupId() == $groupId) { |
|
43 | 1 | return clone $local; |
|
44 | } |
||
45 | } |
||
46 | 2 | return null; |
|
47 | } |
||
48 | |||
49 | 1 | public function readGroup(): array |
|
50 | { |
||
51 | 1 | return $this->local; |
|
52 | } |
||
53 | |||
54 | 2 | public function updateGroup(Interfaces\IGroup $group): bool |
|
71 | } |
||
72 | |||
73 | 2 | public function deleteGroup(string $groupId): bool |
|
74 | { |
||
88 |