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

CsvImporter::loadOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

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