FileGroup   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 9
eloc 22
c 1
b 0
f 0
dl 0
loc 59
ccs 23
cts 23
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupParents() 0 3 1
A getGroupId() 0 3 1
A getGroupAuthorId() 0 3 1
A getGroupDesc() 0 3 1
A getGroupName() 0 3 1
A getGroupExtra() 0 3 1
A getGroupStatus() 0 3 1
A setGroupData() 0 9 2
1
<?php
2
3
namespace kalanis\kw_accounts\Data;
4
5
6
use kalanis\kw_accounts\Interfaces\IGroup;
7
8
9
/**
10
 * Class FileGroup
11
 * @package kalanis\kw_accounts\Data
12
 */
13
class FileGroup implements IGroup
14
{
15
    protected string $id = '0';
16
    protected string $name = '';
17
    protected string $author = '0';
18
    protected string $displayName = '';
19
    protected int $status = 0;
20
    /** @var string[] */
21
    protected array $parents = [];
22
    /** @var array<string|int, string|int|float|bool> */
23
    protected array $extra = [];
24
25 1
    public function setGroupData(?string $id, ?string $name, ?string $desc, ?string $authorId, ?int $status, ?array $parents = [], ?array $extra = []): void
26
    {
27 1
        $this->id = $id ?? $this->id;
28 1
        $this->name = $name ?? $this->name;
29 1
        $this->displayName = $desc ?? $this->displayName;
30 1
        $this->author = $authorId ?? $this->author;
31 1
        $this->status = $status ?? $this->status;
32 1
        $this->parents = $parents ?? $this->parents;
33 1
        $this->extra = !is_null($extra) ? array_merge($this->extra, $extra) : $this->extra;
0 ignored issues
show
introduced by
The condition is_null($extra) is always false.
Loading history...
34 1
    }
35
36 1
    public function getGroupId(): string
37
    {
38 1
        return $this->id;
39
    }
40
41 1
    public function getGroupName(): string
42
    {
43 1
        return $this->name;
44
    }
45
46 1
    public function getGroupAuthorId(): string
47
    {
48 1
        return $this->author;
49
    }
50
51 1
    public function getGroupDesc(): string
52
    {
53 1
        return $this->displayName;
54
    }
55
56 1
    public function getGroupStatus(): int
57
    {
58 1
        return $this->status;
59
    }
60
61
    /**
62
     * @return string[]
63
     */
64 1
    public function getGroupParents(): array
65
    {
66 1
        return $this->parents;
67
    }
68
69 1
    public function getGroupExtra(): array
70
    {
71 1
        return $this->extra;
72
    }
73
}
74