Sources::getPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
namespace kalanis\kw_address_handler\Sources;
4
5
6
/**
7
 * Class ASources
8
 * @package kalanis\kw_address_handler\Sources
9
 * Connect class which contains path to update to the handler
10
 */
11
class Sources
12
{
13
    protected string $address = '';
14
    protected string $path = '';
15
16 3
    public function __toString()
17
    {
18 3
        return $this->getAddress();
19
    }
20
21 9
    public function setAddress(string $address): void
22
    {
23
        // address which begins on two and more slashes might can be understand as relative one with FQDN
24 9
        $this->address = strval(preg_replace('#^(//+)#', '/', $address));
25 9
    }
26
27 9
    public function getAddress(): string
28
    {
29 9
        return $this->address;
30
    }
31
32 7
    public function setPath(string $path): void
33
    {
34 7
        $this->path = $path;
35 7
    }
36
37 1
    public function getPath(): string
38
    {
39 1
        return $this->path;
40
    }
41
}
42