Passed
Push — master ( 25c805...999286 )
by Andy
02:56 queued 11s
created

InlineReader::__construct()   A

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
namespace Palmtree\Csv;
4
5
class InlineReader extends Reader
6
{
7 1
    public function __construct(string $data, bool $hasHeaders = true)
8
    {
9 1
        parent::__construct('php://temp', $hasHeaders);
10
11 1
        $this->getDocument()->fwrite($data);
12 1
    }
13
14 1
    protected function getOpenMode(): string
15
    {
16 1
        return 'r+';
17
    }
18
}
19