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

OutputPath   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 32
ccs 6
cts 8
cp 0.75
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 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