Completed
Push — master ( 9f1a25...922242 )
by De Cramer
10s
created

CsvFileWriterFactory::configureValidator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\Builder\Factories\Loader;
4
5
use Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory;
6
use Oliverde8\Component\PhpEtl\Load\File\Csv;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
/**
10
 * Class FileWriterFactory
11
 *
12
 * @author    de Cramer Oliver<[email protected]>
13
 * @copyright 2018 Oliverde8
14
 * @package Oliverde8\Component\PhpEtl\Builder\Factories\Loader
15
 */
16
class CsvFileWriterFactory extends AbstractFactory
17
{
18
    /**
19
     * @inheritdoc
20
     */
21
    protected function configureValidator()
22
    {
23
        return new Assert\Collection([
24
            'file' => new Assert\NotBlank(),
25
        ]);
26
    }
27
28
29
    /**
30
     * @inheritdoc
31
     */
32
    protected function build($operation, $options)
33
    {
34
        return $this->create(new Csv($options['file']));
35
    }
36
}
37