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

SimpleProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
ccs 0
cts 9
cp 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getControllerNameSpace() 0 3 1
A getRoutesDelegatorNameSpace() 0 3 1
A getShortName() 0 3 1
A __construct() 0 3 1
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