Sources   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 8
c 1
b 0
f 0
dl 0
loc 29
ccs 12
cts 12
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setPath() 0 3 1
A getPath() 0 3 1
A setAddress() 0 4 1
A getAddress() 0 3 1
A __toString() 0 3 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