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

FactoryB::getArrayConfigAndProvidedDependency()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
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