Passed
Branch master (7a2f1a)
by Petr
03:10
created

PathTransform::get()   A

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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
    /** @var IPATranslations */
20
    protected $lang = null;
21
22 40
    public static function get(IPATranslations $lang = null): self
23
    {
24 40
        return new self($lang);
25
    }
26
27 47
    public function __construct(IPATranslations $lang = null)
28
    {
29 47
        $this->lang = $lang ?: new Translations();
30 47
    }
31
32 2
    protected function noDirectoryDelimiterSet(): string
33
    {
34 2
        return $this->lang->paNoDirectoryDelimiterSet();
35
    }
36
}
37