InlineReader::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Palmtree\Csv;
6
7
class InlineReader extends Reader
8
{
9 2
    public function __construct(string $data, bool $hasHeaders = true)
10
    {
11 2
        parent::__construct('php://temp', $hasHeaders);
12
13 2
        $this->getDocument()->fwrite($data);
14 2
    }
15
16 2
    protected function getOpenMode(): string
17
    {
18 2
        return 'r+';
19
    }
20
}
21