Completed
Push — master ( 714e52...03936a )
by Miro
02:26
created

GithubBranchSource::getLastCommitId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace DevBoardLib\GithubCore\Branch;
4
5
use DevBoardLib\GithubCore\Commit\GithubCommit;
6
use DevBoardLib\GithubCore\Repo\GithubRepoId;
7
8
/**
9
 * Class GithubBranchSource.
10
 */
11 View Code Duplication
class GithubBranchSource implements GithubBranch
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /** @var GithubRepoId */
14
    private $githubRepoId;
15
16
    /** @var string */
17
    private $name;
18
19
    /** @var GithubCommit */
20
    private $lastCommit;
21
22
    /**
23
     * GithubBranchSource constructor.
24
     *
25
     * @param GithubRepoId $githubRepoId
26
     * @param string       $name
27
     * @param GithubCommit $lastCommit
28
     */
29
    public function __construct(GithubRepoId $githubRepoId, string $name, GithubCommit $lastCommit)
30
    {
31
        $this->githubRepoId = $githubRepoId;
32
        $this->name         = $name;
33
        $this->lastCommit   = $lastCommit;
34
    }
35
36
    /**
37
     * @return GithubRepoId
38
     */
39
    public function getGithubRepoId() : GithubRepoId
40
    {
41
        return $this->githubRepoId;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getName() : string
48
    {
49
        return $this->name;
50
    }
51
52
    /**
53
     * @return GithubCommit
54
     */
55
    public function getLastCommit() : GithubCommit
56
    {
57
        return $this->lastCommit;
58
    }
59
}
60