Completed
Push — master ( bf487d...84f230 )
by Alessandro
10:10
created

OutputPath::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Paraunit\Configuration;
5
6
/**
7
 * Class OutputPath
8
 * @package Paraunit\Configuration
9
 */
10
class OutputPath
11
{
12
    /** @var string */
13
    private $path;
14
15
    /**
16
     * OutputPath constructor.
17
     * @param string $path
18
     */
19 6
    public function __construct(string $path)
20
    {
21 6
        if ($path === '') {
22 1
            throw new \InvalidArgumentException('Empty path provided: not valid');
23
        }
24
25 5
        $this->path = $path;
26
    }
27
28
    public function isEmpty(): bool
29
    {
30
        return $this->path === null;
31
    }
32
33
    /**
34
     * @return string
35
     * @throws \RuntimeException
36
     */
37 3
    public function getPath(): string
38
    {
39 3
        return $this->path;
40
    }
41
}
42