Passed
Branch development (0519a2)
by Theodoros
02:02
created

FileWriter::setFileName()   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
    /**
17
     * @var \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\Adapter\AdapterInterface
18
     */
19
    protected $fileWriterAdapter;
20
21
    /**
22
     * @param \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\Adapter\AdapterInterface $fileWriterAdapter
23
     */
24
    public function __construct(AdapterInterface $fileWriterAdapter)
25
    {
26
        $this->fileWriterAdapter = $fileWriterAdapter;
27
    }
28
29
    /**
30
     * @param string $fileName
31
     *
32
     * @return $this
33
     */
34
    public function setFileName($fileName)
35
    {
36
        $this->fileWriterAdapter->setFileName($fileName);
37
38
        return $this;
39
    }
40
41
    /**
42
     * @param string $directory
43
     *
44
     * @return $this
45
     */
46
    public function setFolderPath($directory)
47
    {
48
        $this->fileWriterAdapter->setFolderPath($directory);
49
50
        return $this;
51
    }
52
53
    /**
54
     * @param array $dataSet
55
     * @param string $type
56
     *
57
     * @return bool
58
     */
59
    public function write(array $dataSet, $type = '')
60
    {
61
        return (bool)$this->fileWriterAdapter->write($dataSet, $type);
62
    }
63
64
}
65