AbstractWriterConfig   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 52
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDirectory() 0 3 1
A getClassPrefix() 0 3 1
A getClassSuffix() 0 3 1
A getNamespace() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Janisbiz\LightOrm\Generator\Writer;
4
5
abstract class AbstractWriterConfig implements WriterConfigInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $directory;
11
12
    /**
13
     * @var null|string
14
     */
15
    protected $namespace = '';
16
17
    /**
18
     * @var null|string
19
     */
20
    protected $classPrefix = '';
21
22
    /**
23
     * @var null|string
24
     */
25
    protected $classSuffix = '';
26
27
    /**
28
     * @return string
29
     */
30
    public function getDirectory(): string
31
    {
32
        return \rtrim($this->directory, DIRECTORY_SEPARATOR);
33
    }
34
35
    /**
36
     * @return null|string
37
     */
38
    public function getNamespace(): ?string
39
    {
40
        return \trim($this->namespace, '\\');
41
    }
42
43
    /**
44
     * @return null|string
45
     */
46
    public function getClassPrefix(): ?string
47
    {
48
        return \mb_convert_case(\trim($this->classPrefix), MB_CASE_TITLE);
49
    }
50
51
    /**
52
     * @return null|string
53
     */
54
    public function getClassSuffix(): ?string
55
    {
56
        return \mb_convert_case(\trim($this->classSuffix), MB_CASE_TITLE);
57
    }
58
}
59