OutputPath   A
last analyzed

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
3
declare(strict_types=1);
4
5
namespace Paraunit\Configuration;
6
7
/**
8
 * Class OutputPath
9
 * @package Paraunit\Configuration
10
 */
11
class OutputPath
12
{
13
    /** @var string */
14
    private $path;
15
16
    /**
17
     * OutputPath constructor.
18
     * @param string $path
19
     */
20 6
    public function __construct(string $path)
21
    {
22 6
        if ($path === '') {
23 1
            throw new \InvalidArgumentException('Empty path provided: not valid');
24
        }
25
26 5
        $this->path = $path;
27
    }
28
29
    public function isEmpty(): bool
30
    {
31
        return $this->path === null;
32
    }
33
34
    /**
35
     * @return string
36
     * @throws \RuntimeException
37
     */
38 3
    public function getPath(): string
39
    {
40 3
        return $this->path;
41
    }
42
}
43