Passed
Push — feature/gacela-file-cache ( 052688...3add24 )
by Chema
07:28 queued 04:02
created

ModuleGFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
c 0
b 0
f 0
dl 0
loc 19
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\ModuleG;
6
7
use Gacela\Framework\AbstractFactory;
8
use Gacela\Framework\DocBlockResolverAwareTrait;
9
use GacelaTest\Benchmark\Framework\ClassResolver\FileCache\ModuleG\Infra\EntityManager;
10
use GacelaTest\Benchmark\Framework\ClassResolver\FileCache\ModuleG\Infra\Repository;
11
use GacelaTest\Fixtures\StringValueInterface;
12
13
/**
14
 * @method ModuleGConfig getConfig()
15
 * @method Repository getRepository()
16
 * @method EntityManager getEntityManager()
17
 */
18
final class ModuleGFactory extends AbstractFactory
19
{
20
    use DocBlockResolverAwareTrait;
21
22
    private StringValueInterface $stringValue;
23
24
    public function __construct(StringValueInterface $stringValue)
25
    {
26
        $this->stringValue = $stringValue;
27
    }
28
29
    public function getArrayConfigAndProvidedDependency(): array
30
    {
31
        return [
32
            'config-key' => $this->getConfig()->getConfigValue(),
33
            'string-value' => $this->stringValue->value(),
34
            'provided-dependency' => $this->getProvidedDependency('provided-dependency'),
35
            'repository' => $this->getRepository()->getAll(),
36
            'entity-manager' => $this->getEntityManager()->updateEntity(),
37
        ];
38
    }
39
}
40