XSendFileStreamer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
c 0
b 0
f 0
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A stream() 0 7 1
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