CsvExporter::loadOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php namespace Arcanedev\LaravelExcel\Exporters;
2
3
use Box\Spout\Common\Type;
4
5
/**
6
 * Class     CsvExporter
7
 *
8
 * @package  Arcanedev\LaravelExcel\Exporter
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CsvExporter extends AbstractExporter
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
18
    /** @var string */
19
    protected $type = Type::CSV;
20
21
    /** @var \Box\Spout\Writer\CSV\Writer */
22
    protected $writer;
23
24
    /* -----------------------------------------------------------------
25
     |  Other Methods
26
     | -----------------------------------------------------------------
27
     */
28
29
    /**
30
     * Load the writer options.
31
     */
32 3
    protected function loadOptions()
33
    {
34 3
        $this->writer
35 3
             ->setFieldDelimiter($this->getOption('field-delimiter', ';'))
36 3
             ->setFieldEnclosure($this->getOption('field-enclosure', '"'))
37 3
             ->setShouldAddBOM($this->getOption('add-bom', true));
38 3
    }
39
}
40