DeleteFilesForOldExecutionFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Oliverde8\PhpEtlBundle\Etl\OperationFactory\Cleanup;
4
5
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
6
use Oliverde8\Component\PhpEtl\ChainOperation\ChainOperationInterface;
7
use Oliverde8\PhpEtlBundle\Etl\Operation\Cleanup\DeleteFilesForOldExecutionOperation;
8
use Oliverde8\PhpEtlBundle\Repository\EtlExecutionRepository;
9
use Oliverde8\PhpEtlBundle\Services\ChainWorkDirManager;
10
use Oliverde8\PhpEtlBundle\Services\FileSystemFactoryInterface;
11
use Symfony\Component\Validator\Constraints as Assert;
12
13
class DeleteFilesForOldExecutionFactory extends AbstractFactory
14
{
15
    /** @var ChainWorkDirManager */
16
    protected $chainWorkdDirManager;
17
18
    protected FileSystemFactoryInterface $fileSystemFactory;
19
20
    public function __construct(ChainWorkDirManager $chainWorkdDirManager, FileSystemFactoryInterface $fileSystemFactory)
21
    {
22
        $this->chainWorkdDirManager = $chainWorkdDirManager;
23
        $this->fileSystemFactory = $fileSystemFactory;
24
25
        $this->operation = 'Etl/Cleanup/DeleteFilesForOldExecution';
26
        $this->class = DeleteFilesForOldExecutionOperation::class;
27
    }
28
29
    protected function build(string $operation, array $options): ChainOperationInterface
30
    {
31
        return $this->create($this->chainWorkdDirManager, $this->fileSystemFactory);
32
    }
33
}
34