Completed
Push — master ( f81cf6...7fbbb0 )
by Oleg
03:40
created

BaseProvider::provide()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator\DataProvider;
5
6
use SlayerBirden\DFCodeGeneration\Util\Lexer;
7
8
final class BaseProvider implements DataProviderInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $entityClassName;
14
15 2
    public function __construct(string $entityClassName)
16
    {
17 2
        $this->entityClassName = $entityClassName;
18 2
    }
19
20
    /**
21
     * @return array
22
     * @throws \ReflectionException
23
     */
24 2
    public function provide(): array
25
    {
26
        return [
27 2
            'entityName' => $this->entityClassName,
28 2
            'refName' => Lexer::getRefName($this->entityClassName),
29 2
            'entityClassName' => Lexer::getBaseName($this->entityClassName),
30
        ];
31
    }
32
}
33