CommitRef   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A getMode() 0 3 1
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of Biurad opensource projects.
5
 *
6
 * @copyright 2022 Biurad Group (https://biurad.com/)
7
 * @license   https://opensource.org/licenses/BSD-3-Clause License
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Biurad\Git\Commit;
14
15
/**
16
 * A git ref of a commit containing only the hash.
17
 *
18
 * @author Divine Niiquaye Ibok <[email protected]>
19
 */
20
class CommitRef implements \Stringable
21
{
22
    private string $hash;
23
24
    public function __construct(string $commitHash, private ?int $mode = null)
25
    {
26
        $this->hash = $commitHash;
27
    }
28
29
    public function __toString(): string
30
    {
31
        return $this->hash;
32
    }
33
34
    public function getMode(): ?int
35
    {
36
        return $this->mode;
37
    }
38
}
39