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

BaseProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1
wmc 2

2 Methods

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