Completed
Push — master ( 455502...ee7d83 )
by Alessandro
06:34
created

StaticOutputPath   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPath() 0 8 2
1
<?php
2
3
namespace Paraunit\Configuration;
4
5
/**
6
 * Class StaticOutputPath
7
 * @package Paraunit\Configuration
8
 */
9
class StaticOutputPath extends \PHPUnit_Framework_BaseTestListener
10
{
11
    /** @var string */
12
    private static $path;
13
14
    /**
15
     * StaticOutputPath constructor.
16
     * @param $path
17
     */
18
    public function __construct($path)
19
    {
20
        self::$path = $path;
21
    }
22
23
    /**
24
     * @return string
25
     * @throws \RuntimeException If not ready
26
     */
27
    public static function getPath()
28
    {
29
        if (null === self::$path) {
30
            throw new \RuntimeException('Output path not received, not ready!');
31
        }
32
33
        return self::$path;
34
    }
35
}
36