InlineReader   A
last analyzed

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
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