Completed
Push — master ( 6873e8...20cc66 )
by Miro
02:52 queued 48s
created

GithubUserSource   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 71
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 71
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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
namespace DevBoardLib\GithubCore\User;
3
4
use DevBoardLib\GithubCore\User\GithubUser;
5
use DevBoardLib\GithubCore\User\GithubUserId;
6
7
class GithubUserSource implements GithubUser
8
{
9
    /** @var GithubUserId */
10
    private $githubUserId;
11
    /** @var string */
12
    private $username;
13
    /** @var string */
14
    private $email;
15
    /** @var string */
16
    private $name;
17
    /** @var string */
18
    private $avatarUrl;
19
20
    /**
21
     * GithubUserSource constructor.
22
     *
23
     * @param GithubUserId $githubUserId
24
     * @param string       $username
25
     * @param string       $email
26
     * @param string       $name
27
     * @param string       $avatarUrl
28
     */
29
    public function __construct(GithubUserId $githubUserId, $username, $email = null, $name = null, $avatarUrl)
30
    {
31
        $this->githubUserId = $githubUserId;
32
        $this->username     = $username;
33
        $this->email        = $email;
34
        $this->name         = $name;
35
        $this->avatarUrl    = $avatarUrl;
36
    }
37
38
    /**
39
     * @return GithubUserId
40
     */
41
    public function getGithubUserId()
42
    {
43
        return $this->githubUserId;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getUsername()
50
    {
51
        return $this->username;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getEmail()
58
    {
59
        return $this->email;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getName()
66
    {
67
        return $this->name;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getAvatarUrl()
74
    {
75
        return $this->avatarUrl;
76
    }
77
}
78