Total Complexity | 3 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Csv implements CsvInterface |
||
15 | { |
||
16 | /** @var string */ |
||
17 | protected string $file; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected string $separator; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected string $enclosure; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected string $escape; |
||
27 | |||
28 | /** |
||
29 | * Reader constructor. |
||
30 | * |
||
31 | * @param string $file |
||
32 | * @param string $separator |
||
33 | * @param string $enclosure |
||
34 | * @param string $escape |
||
35 | */ |
||
36 | public function __construct( |
||
37 | string $file, |
||
38 | string $separator = ',', |
||
39 | string $enclosure = '"', |
||
40 | string $escape = "\\", |
||
41 | ) { |
||
42 | $this->file = $file; |
||
43 | $this->separator = $separator; |
||
44 | $this->enclosure = $enclosure; |
||
45 | $this->escape = $escape; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | public function writer(string $mode = 'a+'): WriterInterface |
||
59 | ); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | public function reader(string $mode = 'r'): ReaderInterface |
||
76 |