CsvExporter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadOptions() 0 7 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