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

HostMount   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sourcePath() 0 3 1
A __construct() 0 6 1
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
}