CheckedOutRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 2 1
A fromPath() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Roave\BackwardCompatibility\Git;
6
7
use Assert\Assert;
8
9
final class CheckedOutRepository
10
{
11
    /** @var string */
12
    private $path;
13
14
    private function __construct()
15
    {
16
    }
17
18
    public static function fromPath(string $path) : self
19
    {
20
        Assert::that($path . '/.git')->directory();
21
        $instance       = new self();
22
        $instance->path = $path;
23
24
        return $instance;
25
    }
26
27
    public function __toString() : string
28
    {
29
        return $this->path;
30
    }
31
}
32