Csv::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Spreadsheet\File;
5
6
use Innmind\Filesystem\{
7
    File,
8
    StreamInterface,
9
    MediaType\MediaType
10
};
11
12
final class Csv extends File
13
{
14 6
    public function __construct(string $name, StreamInterface $content)
15
    {
16 6
        parent::__construct(
17 6
            basename($name, '.csv').'.csv',
18
            $content,
19 6
            MediaType::fromString('text/csv')
20
        );
21 6
    }
22
}
23