Passed
Branch development (62ef01)
by Theodoros
06:18
created

FileWriter::setFolderPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Econda\Business\Exporter\Writer\File;
9
10
use SprykerEco\Zed\Econda\Business\Exporter\Writer\File\Adapter\AdapterInterface;
11
use SprykerEco\Zed\Econda\Business\Exporter\Writer\WriterInterface;
12
13
class FileWriter implements WriterInterface
14
{
15
    /**
16
     * @var \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\Adapter\AdapterInterface
17
     */
18
    protected $fileWriterAdapter;
19
20
    /**
21
     * @param \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\Adapter\AdapterInterface $fileWriterAdapter
22
     */
23
    public function __construct(AdapterInterface $fileWriterAdapter)
24
    {
25
        $this->fileWriterAdapter = $fileWriterAdapter;
26
    }
27
28
    /**
29
     * @param string $fileName
30
     *
31
     * @return $this
32
     */
33
    public function setFileName($fileName)
34
    {
35
        $this->fileWriterAdapter->setFileName($fileName);
36
37
        return $this;
38
    }
39
40
    /**
41
     * @param string $directory
42
     *
43
     * @return $this
44
     */
45
    public function setFolderPath($directory)
46
    {
47
        $this->fileWriterAdapter->setFolderPath($directory);
48
49
        return $this;
50
    }
51
52
    /**
53
     * @param array $dataSet
54
     * @param string $type
55
     *
56
     * @return bool
57
     */
58
    public function write(array $dataSet, $type = '')
59
    {
60
        return $this->fileWriterAdapter->write($dataSet, $type);
61
    }
62
}
63