Remote   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getPushUrl() 0 3 1
A getFetchUrl() 0 3 1
A __toString() 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;
14
15
/**
16
 * Git Remote Object.
17
 *
18
 * @author Divine Niiquaye Ibok <[email protected]>
19
 */
20
class Remote implements \Stringable
21
{
22
    private string $push;
23
24
    public function __construct(private string $name, private string $fetch, string $push = null)
25
    {
26
        $this->push = $push ?? $fetch;
27
    }
28
29
    public function __toString(): string
30
    {
31
        return $this->name;
32
    }
33
34
    public function getFetchUrl(): string
35
    {
36
        return $this->fetch;
37
    }
38
39
    public function getPushUrl(): string
40
    {
41
        return $this->push;
42
    }
43
}
44