GithubUserSource::getGithubUserId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace DevBoardLib\GithubCore\User;
4
5
/**
6
 * Class GithubUserSource.
7
 */
8
class GithubUserSource implements GithubUser
9
{
10
    /** @var GithubUserId */
11
    private $githubUserId;
12
    /** @var string */
13
    private $username;
14
    /** @var string */
15
    private $email;
16
    /** @var string */
17
    private $name;
18
    /** @var string */
19
    private $avatarUrl;
20
21
    /**
22
     * GithubUserSource constructor.
23
     *
24
     * @param GithubUserId $githubUserId
25
     * @param string       $username
26
     * @param string       $email
27
     * @param string       $name
28
     * @param string       $avatarUrl
29
     */
30
    public function __construct(
31
        GithubUserId $githubUserId,
32
        string $username,
33
        string $email = null,
34
        string $name = null,
35
        string $avatarUrl = null
36
    ) {
37
        $this->githubUserId = $githubUserId;
38
        $this->username     = $username;
39
        $this->email        = $email;
40
        $this->name         = $name;
41
        $this->avatarUrl    = $avatarUrl;
42
    }
43
44
    /**
45
     * @return GithubUserId
46
     */
47
    public function getGithubUserId() : GithubUserId
48
    {
49
        return $this->githubUserId;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getUsername() : string
56
    {
57
        return $this->username;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getEmail() : string
64
    {
65
        return $this->email;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getName() : string
72
    {
73
        return $this->name;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getAvatarUrl() : string
80
    {
81
        return $this->avatarUrl;
82
    }
83
}
84