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

CsvImporter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 30
c 0
b 0
f 0
wmc 1
lcom 1
cbo 3
ccs 9
cts 9
cp 1
rs 10

1 Method

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