PathTransform   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A noDirectoryDelimiterSet() 0 3 1
A __construct() 0 3 2
A get() 0 3 1
1
<?php
2
3
namespace kalanis\kw_paths\Extras;
4
5
6
use kalanis\kw_paths\Interfaces\IPATranslations;
7
use kalanis\kw_paths\Translations;
8
9
10
/**
11
 * Class PathTransform
12
 * @package kalanis\kw_paths\Extras
13
 * Just implementation of transformation of names
14
 */
15
class PathTransform
16
{
17
    use TPathTransform;
18
19
    protected IPATranslations $lang;
20
21 11
    public static function get(IPATranslations $lang = null): self
22
    {
23 11
        return new self($lang);
24
    }
25
26 18
    public function __construct(IPATranslations $lang = null)
27
    {
28 18
        $this->lang = $lang ?: new Translations();
29
    }
30
31 2
    protected function noDirectoryDelimiterSet(): string
32
    {
33 2
        return $this->lang->paNoDirectoryDelimiterSet();
34
    }
35
}
36