Passed
Push — master ( e66d23...e16cc9 )
by Mariano
02:32 queued 01:03
created

Path   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A absoluteOrRelativeToCodeceptionDir() 0 6 2
A __construct() 0 3 1
1
<?php
2
3
namespace Mcustiel\Phiremock\Codeception\Extension;
4
5
use Codeception\Configuration;
6
7
class Path
8
{
9
    /** @var string */
10
    private $path;
11
12
    public function __construct(string $path)
13
    {
14
        $this->path = $path;
15
    }
16
17
    public function absoluteOrRelativeToCodeceptionDir(): string
18
    {
19
        if (substr($this->path, 0, 1) === '/') {
20
            return $this->path;
21
        }
22
        return Configuration::projectDir() . $this->path;
23
    }
24
}
25