Completed
Push — master ( 5da4b2...7163c3 )
by Miro
04:03 queued 01:19
created

GithubCommitId::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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