PathTransform::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 2
nc 1
nop 1
crap 2
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