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

PathTransform   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
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 20
ccs 7
cts 7
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
    /** @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