Passed
Pull Request — master (#21)
by De Cramer
07:15
created

CsvExtractFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 10
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
            $options['scoped'] ?? false,
20
        );
21
    }
22
}