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

OutputPath   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 32
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A isEmpty() 0 4 1
A getPath() 0 4 1
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