Completed
Push — master ( 9a7b87...ad20a3 )
by Alessandro
03:07
created

OutputPath::getPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
    public function __construct(string $path)
20
    {
21
        if ($path === '') {
22
            throw new \InvalidArgumentException('Empty path provided: not valid');
23
        }
24
25
        $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
    public function getPath(): string
38
    {
39
        return $this->path;
40
    }
41
}
42