Passed
Push — master ( f03d23...eaba00 )
by Petr
02:26
created

FileGroup::setGroupData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 6
dl 0
loc 8
ccs 7
cts 7
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace kalanis\kw_auth\Data;
4
5
6
use kalanis\kw_auth\Interfaces\IGroup;
7
8
9
/**
10
 * Class FileGroup
11
 * @package kalanis\kw_auth\Data
12
 */
13
class FileGroup implements IGroup
14
{
15
    /** @var string */
16
    protected $id = '0';
17
    /** @var string */
18
    protected $name = '';
19
    /** @var string */
20
    protected $author = '0';
21
    /** @var string */
22
    protected $displayName = '';
23
    /** @var int */
24
    protected $status = 0;
25
    /** @var string[] */
26
    protected $parents = [];
27
28 31
    public function setGroupData(?string $id, ?string $name, ?string $desc, ?string $authorId, ?int $status, ?array $parents = []): void
29
    {
30 31
        $this->id = $id ?? $this->id;
31 31
        $this->name = $name ?? $this->name;
32 31
        $this->displayName = $desc ?? $this->displayName;
33 31
        $this->author = $authorId ?? $this->author;
34 31
        $this->status = $status ?? $this->status;
35 31
        $this->parents = $parents ?? $this->parents;
36 31
    }
37
38 7
    public function getGroupId(): string
39
    {
40 7
        return $this->id;
41
    }
42
43 25
    public function getGroupName(): string
44
    {
45 25
        return $this->name;
46
    }
47
48 25
    public function getGroupAuthorId(): string
49
    {
50 25
        return $this->author;
51
    }
52
53 31
    public function getGroupDesc(): string
54
    {
55 31
        return $this->displayName;
56
    }
57
58 9
    public function getGroupStatus(): int
59
    {
60 9
        return $this->status;
61
    }
62
63
    /**
64
     * @return string[]
65
     */
66 8
    public function getGroupParents(): array
67
    {
68 8
        return $this->parents;
69
    }
70
}
71