Completed
Push — master ( 2d8594...e4f915 )
by Vladimir
02:37
created

User::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Drivers;
6
7
class User
8
{
9
    private $id;
10
    private $name;
11
    private $username;
12
    private $data;
13
14 2
    public function __construct(string $id, string $name = null, string $username = null, array $data = [])
15
    {
16 2
        $this->id = $id;
17 2
        $this->name = $name;
18 2
        $this->username = $username;
19 2
        $this->data = $data;
20 2
    }
21
22
    /**
23
     * Identifier.
24
     *
25
     * @return string
26
     */
27 2
    public function getId(): string
28
    {
29 2
        return $this->id;
30
    }
31
32
    /**
33
     * Full name.
34
     *
35
     * @return string|null
36
     */
37 2
    public function getName(): ?string
38
    {
39 2
        return $this->name;
40
    }
41
42
    /**
43
     * Username.
44
     *
45
     * @return string|null
46
     */
47 2
    public function getUsername(): ?string
48
    {
49 2
        return $this->username;
50
    }
51
52
    /**
53
     * Additional user information.
54
     *
55
     * @return array
56
     */
57 1
    public function getData(): array
58
    {
59 1
        return $this->data;
60
    }
61
}
62