Test Setup Failed
Push — master ( 7ec5cf...f827c6 )
by Phan
04:13
created

AlbumInfoController::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Http\Controllers\API;
4
5
use App\Models\Album;
6
use Illuminate\Http\JsonResponse;
7
8
class AlbumInfoController extends Controller
9
{
10
    /**
11
     * Get extra information about an album via Last.fm.
12
     *
13
     * @param Album $album
14
     *
15
     * @return JsonResponse
16
     */
17
    public function show(Album $album)
18
    {
19
        return response()->json($album->getInfo());
0 ignored issues
show
Security Bug introduced by
It seems like $album->getInfo() targeting App\Models\Album::getInfo() can also be of type false; however, Illuminate\Contracts\Rou...ResponseFactory::json() does only seem to accept string|array, did you maybe forget to handle an error condition?
Loading history...
20
    }
21
}
22