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

InlineReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getOpenMode() 0 3 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