Completed
Push — master ( 005d42...c6a537 )
by ARCANEDEV
9s
created

CsvExporter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadOptions() 0 13 1
1
<?php namespace Arcanedev\LaravelExcel\Exporters;
2
3
use Box\Spout\Common\Type;
4
use Illuminate\Support\Arr;
5
6
/**
7
 * Class     CsvExporter
8
 *
9
 * @package  Arcanedev\LaravelExcel\Exporter
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class CsvExporter extends AbstractExporter
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
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 Functions
26
     | ------------------------------------------------------------------------------------------------
27
     */
28
    /**
29
     * Load the writer options.
30
     */
31
    protected function loadOptions()
32
    {
33
        $this->writer
34
            ->setFieldDelimiter(
35
                Arr::get($this->options, 'field-delimiter', ';')
36
            )
37
            ->setFieldEnclosure(
38
                Arr::get($this->options, 'field-enclosure', '"')
39
            )
40
            ->setShouldAddBOM(
41
                Arr::get($this->options, 'add-bom', true)
42
            );
43
    }
44
}
45