Doctrine   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getConfig() 0 7 1
A getCode() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator\Config\Parts;
5
6
use SlayerBirden\DFCodeGeneration\Generator\Config\ConfigPartInterface;
7
use SlayerBirden\DFCodeGeneration\Generator\DataProvider\DataProviderInterface;
8
9
final class Doctrine implements ConfigPartInterface
10
{
11
    const PART_KEY = 'doctrine';
12
13
    /**
14
     * @var DataProviderInterface
15
     */
16
    private $dataProvider;
17
18 10
    public function __construct(DataProviderInterface $dataProvider)
19
    {
20 10
        $this->dataProvider = $dataProvider;
21 10
    }
22
23 10
    public function getConfig(): array
24
    {
25
        return [
26
            'entity_managers' => [
27
                'default' => [
28
                    'paths' => [
29 10
                        $this->dataProvider->provide()['entities_src'],
30
                    ],
31
                ],
32
            ],
33
        ];
34
    }
35
36
    /**
37
     * Part Code
38
     *
39
     * @return string
40
     */
41 10
    public function getCode(): string
42
    {
43 10
        return self::PART_KEY;
44
    }
45
}
46