XSendFileStreamer::stream()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 5
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace App\Services\Streamers;
4
5
class XSendFileStreamer extends Streamer implements DirectStreamerInterface
6
{
7
    /**
8
     * Stream the current song using Apache's x_sendfile module.
9
     */
10
    public function stream(): void
11
    {
12
        header("X-Sendfile: {$this->song->path}");
13
        header("Content-Type: {$this->contentType}");
14
        header('Content-Disposition: inline; filename="'.basename($this->song->path).'"');
15
16
        exit;
17
    }
18
}
19