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

CsvFileWriterFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A configureValidator() 0 4 1
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