Completed
Pull Request — master (#1)
by De Cramer
02:11
created

FileWriterFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 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\ChainOperation\ChainOperationInterface;
7
use Oliverde8\Component\PhpEtl\Load\File\Csv;
8
use Oliverde8\Component\PhpEtl\Load\File\FileWriterInterface;
9
10
/**
11
 * Class FileWriterFactory
12
 *
13
 * @author    de Cramer Oliver<[email protected]>
14
 * @copyright 2018 Oliverde8
15
 * @package Oliverde8\Component\PhpEtl\Builder\Factories\Loader
16
 */
17
class FileWriterFactory extends AbstractFactory
18
{
19
    /**
20
     * Build an operation of a certain type with the options.
21
     *
22
     * @param String $operation
23
     * @param array $options
24
     *
25
     * @return ChainOperationInterface
26
     */
27
    protected function build($operation, $options)
28
    {
29
        // TODO handle other then csv.
30
        return $this->create(new Csv($options['file']));
0 ignored issues
show
Bug introduced by
new Oliverde8\Component\...e\Csv($options['file']) of type Oliverde8\Component\PhpEtl\Load\File\Csv is incompatible with the type array expected by parameter $arguments of Oliverde8\Component\PhpE...stractFactory::create(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

30
        return $this->create(/** @scrutinizer ignore-type */ new Csv($options['file']));
Loading history...
31
    }
32
}
33