Passed
Push — master ( 61fa52...b9d74d )
by Vladimir
13:13
created

User::getUsername()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
13
    public function __construct(string $id, string $name = null, string $username = null)
14
    {
15
        $this->id = $id;
16
        $this->name = $name;
17
        $this->username = $username;
18
    }
19
20
    /**
21
     * Identifier.
22
     *
23
     * @return string
24
     */
25
    public function getId(): string
26
    {
27
        return $this->id;
28
    }
29
30
    /**
31
     * Full name.
32
     *
33
     * @return string|null
34
     */
35
    public function getName(): ?string
36
    {
37
        return $this->name;
38
    }
39
40
    /**
41
     * Username.
42
     *
43
     * @return string|null
44
     */
45
    public function getUsername(): ?string
46
    {
47
        return $this->username;
48
    }
49
}
50