Passed
Pull Request — master (#208)
by Jesús
07:17 queued 03:55
created

FactoryE   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getArrayConfigAndProvidedDependency() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Benchmark\Framework\ClassResolver\FileCache\ModuleE;
6
7
use Gacela\Framework\AbstractFactory;
8
use Gacela\Framework\DocBlockResolverAwareTrait;
9
use GacelaTest\Benchmark\Framework\ClassResolver\FileCache\ModuleE\Infra\EntityManager;
10
use GacelaTest\Benchmark\Framework\ClassResolver\FileCache\ModuleE\Infra\Repository;
11
use GacelaTest\Fixtures\StringValueInterface;
12
13
/**
14
 * @method ConfigE getConfig()
15
 * @method Repository getRepository()
16
 * @method EntityManager getEntityManager()
17
 */
18
final class FactoryE extends AbstractFactory
19
{
20
    use DocBlockResolverAwareTrait;
21
    private StringValueInterface $stringValue;
22
23
    public function __construct(StringValueInterface $stringValue)
24
    {
25
        $this->stringValue = $stringValue;
26
    }
27
28
    public function getArrayConfigAndProvidedDependency(): array
29
    {
30
        return [
31
            'config-key' => $this->getConfig()->getConfigValue(),
32
            'string-value' => $this->stringValue->value(),
33
            'provided-dependency' => $this->getProvidedDependency('provided-dependency'),
34
            'repository' => $this->getRepository()->getAll(),
35
            'entity-manager' => $this->getEntityManager()->updateEntity(),
36
        ];
37
    }
38
}
39