Passed
Push — master ( 743cc2...6ffec3 )
by Oleg
02:50
created

NamingTrait::getBaseName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator;
5
6
use Zend\Code\Reflection\ClassReflection;
7
8
trait NamingTrait
9
{
10
    /**
11
     * @param string $entityClassName
12
     * @return string
13
     * @throws \ReflectionException
14
     */
15 9
    protected function getBaseName(string $entityClassName): string
16
    {
17 9
        $reflection = new ClassReflection($entityClassName);
18 9
        return $reflection->getShortName();
19
    }
20
}
21