Passed
Push — master ( 956163...dedbc7 )
by Christian
03:02
created

HostMount::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Cocotte\Host;
4
5
use Assert\Assertion;
6
use Cocotte\Environment\LazyEnvironmentValue;
7
8
class HostMount implements LazyEnvironmentValue
9
{
10
    /**
11
     * @var array
12
     */
13
    private $value;
14
15
    public function __construct(array $value)
16
    {
17
        Assertion::keyExists($value, 'Source');
18
        Assertion::string($value['Source']);
19
20
        $this->value = $value;
21
    }
22
23
    /**
24
     * Absolute path on the host filesystem
25
     *
26
     * @return string
27
     */
28
    public function sourcePath(): string
29
    {
30
        return $this->value['Source'];
31
    }
32
}