Completed
Push — master ( 3a2809...fa6500 )
by Pieter
03:01
created

Branch   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isActive() 0 4 1
A getName() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Gitilicious\GitClient\Git;
4
5
class Branch
6
{
7
    private $active = false;
8
9 3
    private $name;
10
11 3
    public function __construct(string $name)
12 3
    {
13
        $this->active = strpos($name, '* ') === 0;
14 2
        $this->name   = ltrim($name, '* ');
15
    }
16 2
17
    public function isActive(): bool
18
    {
19
        return $this->active;
20
    }
21
22
    public function getName(): string
23
    {
24
        return $this->name;
25
    }
26
}
27