Doctrine::getConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 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