Passed
Pull Request — master (#21)
by De Cramer
02:27 queued 49s
created

CsvExtractFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 7 1
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\Builder\Factories\Extract;
4
5
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
6
use Oliverde8\Component\PhpEtl\ChainOperation\ChainOperationInterface;
7
use Symfony\Component\Validator\Constraint;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
class CsvExtractFactory extends AbstractFactory
11
{
12
    protected function build(string $operation, array $options): ChainOperationInterface
13
    {
14
        return $this->create(
15
            $options['delimiter'] ?? ";",
16
            $options['enclosure'] ?? '"',
17
            $options['escape'] ?? '\\',
18
            $options['fileKey'] ?? 'file',
19
        );
20
    }
21
}