Csv   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Infrastructure Related Agent
5
 * @author Max Demian <[email protected]>
6
 */
7
8
namespace Ticaje\FileManager\Infrastructure\Driver\Reader\File;
9
10
use Ticaje\FileManager\Infrastructure\Driver\Reader\Interfaces\Gateway\CsvFileInterface;
11
use Ticaje\FileManager\Infrastructure\Driver\Reader\Interfaces\FileInterface;
12
use Ticaje\FileManager\Infrastructure\Driver\Reader\Interfaces\SourceInterface;
13
14
/**
15
 * Class Csv
16
 * @package Ticaje\FileManager\Infrastructure\Driver\Reader\File
17
 */
18
class Csv extends Base implements SourceInterface, FileInterface
19
{
20
    /** @var string $delimiter */
21
    private $delimiter = ';';
22
23
    /**
24
     * Csv constructor.
25
     *
26
     * @param CsvFileInterface $implementor
27
     * @param bool             $hasHeader
28
     * @param string|null      $delimiter
29
     */
30
    public function __construct(
31
        CsvFileInterface $implementor,
32
        bool $hasHeader = false,
33
        string $delimiter = null
34
    ) {
35
        $implementor->setDelimiter($delimiter ?? $this->delimiter);
36
        parent::__construct($implementor, $hasHeader);
37
    }
38
}
39