PlaylistController::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Http\Controllers\API\Download;
4
5
use App\Models\Playlist;
6
use Illuminate\Auth\Access\AuthorizationException;
7
8
/**
9
 * @group 6. Download
10
 */
11
class PlaylistController extends Controller
12
{
13
    /**
14
     * Download a whole playlist.
15
     *
16
     * @response []
17
     *
18
     * @throws AuthorizationException
19
     */
20 1
    public function show(Playlist $playlist)
21
    {
22 1
        $this->authorize('owner', $playlist);
23
24 1
        return response()->download($this->downloadService->from($playlist));
25
    }
26
}
27