Passed
Push — main ( 6230b7...ae23f2 )
by Chema
04:12
created

FactoryB   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

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