Passed
Push — master ( 38bb21...58e144 )
by De Cramer
08:33
created

AbstractCsvFile::getResource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Oliverde8\Component\PhpEtl\Model\File;
4
5
/**
6
 * Class AbstractFile
7
 *
8
 * @author    de Cramer Oliver<[email protected]>
9
 * @copyright 2018 Oliverde8
10
 * @package Oliverde8\Component\PhpEtl\Model\File
11
 */
12
class AbstractCsvFile
13
{
14
    /** @var String */
15
    protected $filePath;
16
17
    /** @var string */
18
    protected $delimiter;
19
20
    /** @var string */
21
    protected $enclosure;
22
23
    /** @var string */
24
    protected $escape;
25
26
    /** @var resource File pointer */
27
    protected $file = null;
28
29
    /**
30
     * Reader constructor.
31
     *
32
     * @param string $filePath  Path to the csv file.
33
     * @param string $delimiter Delimiter to use for the csv file.
34
     * @param string $enclosure Enclosure to use for the csv file.
35
     * @param string $escape    Escape to use for the csv file.
36
     */
37
    public function __construct($filePath, $delimiter = ';', $enclosure = '"', $escape = '\\')
38
    {
39
        $this->filePath = $filePath;
40
        $this->delimiter = $delimiter;
41
        $this->enclosure = $enclosure;
42
        $this->escape = $escape;
43
    }
44
45
    public function getResource()
46
    {
47
        return $this->file;
48
    }
49
}
50