Passed
Push — master ( 4826f7...743cc2 )
by Oleg
04:24
created

SimpleProvider::getRoutesDelegatorNameSpace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator\Factory;
5
6
use SlayerBirden\DFCodeGeneration\Generator\Controllers\NamingTrait as ControllerNamingTrait;
7
8
class SimpleProvider implements DataProviderInterface
9
{
10
    use NamingTrait, ControllerNamingTrait {
11
        NamingTrait::getBaseName insteadof ControllerNamingTrait;
12
        NamingTrait::getNs insteadof ControllerNamingTrait;
13
        ControllerNamingTrait::getNs as getControllerNs;
14
    }
15
16
    /**
17
     * @var string
18
     */
19
    private $entityClassName;
20
21
    public function __construct(string $entityClassName)
22
    {
23
        $this->entityClassName = $entityClassName;
24
    }
25
26
    public function getRoutesDelegatorNameSpace(): string
27
    {
28
        return $this->getNs($this->entityClassName);
29
    }
30
31
    public function getControllerNameSpace(): string
32
    {
33
        return $this->getControllerNs($this->entityClassName);
34
    }
35
36
    /**
37
     * @return string
38
     * @throws \ReflectionException
39
     */
40
    public function getShortName(): string
41
    {
42
        return $this->getBaseName($this->entityClassName);
43
    }
44
}
45