Passed
Push — main ( bd03c4...c6ca62 )
by De Cramer
04:36
created

DeleteEntityForOldExecutionFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
namespace Oliverde8\PhpEtlBundle\Etl\OperationFactory\Cleanup;
4
5
use Doctrine\ORM\EntityManagerInterface;
6
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
7
use Oliverde8\Component\PhpEtl\ChainOperation\ChainOperationInterface;
8
use Oliverde8\PhpEtlBundle\Etl\Operation\Cleanup\DeleteEntityForOldExecutionOperation;
9
use Oliverde8\PhpEtlBundle\Repository\EtlExecutionRepository;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
class DeleteEntityForOldExecutionFactory extends AbstractFactory
13
{
14
    /** @var EntityManagerInterface  */
15
    protected EntityManagerInterface $em;
16
17
    /**
18
     * DeleteEntityForOldExecutionOperation constructor.
19
     * @param EntityManagerInterface $em
20
     */
21
    public function __construct(EntityManagerInterface $em)
22
    {
23
        $this->em = $em;
24
25
        $this->operation = 'Etl/Cleanup/DeleteEntityForOldExecution';
26
        $this->class = DeleteEntityForOldExecutionOperation::class;
27
    }
28
29
    /**
30
     * Build an operation of a certain type with the options.
31
     *
32
     * @param String $operation
33
     * @param array $options
34
     *
35
     * @return ChainOperationInterface
36
     */
37
    protected function build($operation, $options)
38
    {
39
        return $this->create($this->em);
40
    }
41
}
42