Completed
Pull Request — master (#20)
by Miro
02:18
created

GithubCommitId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
1
<?php
2
namespace DevBoardLib\GithubCore\Commit;
3
4
use DevBoardLib\GithubCore\Identifier;
5
use DevBoardLib\GithubCore\Repo\GithubRepoId;
6
7
/**
8
 * Class GithubCommitId.
9
 */
10
class GithubCommitId implements Identifier
11
{
12
    /** @var GithubRepoId */
13
    private $githubRepoId;
14
    /** @var GithubCommitSha */
15
    private $commitSha;
16
17
    /**
18
     * BranchId constructor.
19
     *
20
     * @param GithubRepoId    $githubRepoId
21
     * @param GithubCommitSha $commitSha
22
     */
23
    public function __construct(GithubRepoId $githubRepoId, GithubCommitSha $commitSha)
24
    {
25
        $this->githubRepoId = $githubRepoId;
26
        $this->commitSha    = $commitSha;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function __toString()
33
    {
34
        return $this->githubRepoId->__toString().'-'.$this->commitSha->__toString();
35
    }
36
}
37