CheckedOutRepository::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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