AbstractWriterConfig::getNamespace()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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