GithubUserSource   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 76
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getGithubUserId() 0 4 1
A getUsername() 0 4 1
A getEmail() 0 4 1
A getName() 0 4 1
A getAvatarUrl() 0 4 1
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