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

GithubCommitSha   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

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