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

BatchLikeController::store()   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\Interaction;
4
5
use App\Http\Requests\API\BatchInteractionRequest;
6
use App\Models\Interaction;
7
use Illuminate\Http\JsonResponse;
8
9
class BatchLikeController extends Controller
10
{
11
    /**
12
     * Like several songs at once as the currently authenticated user.
13
     *
14
     * @param BatchInteractionRequest $request
15
     *
16
     * @return JsonResponse
17
     */
18
    function store(BatchInteractionRequest $request)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
19
    {
20
        return response()->json(Interaction::batchLike((array) $request->songs, $request->user()));
21
    }
22
23
    /**
24
     * Unlike several songs at once as the currently authenticated user.
25
     *
26
     * @param BatchInteractionRequest $request
27
     *
28
     * @return JsonResponse
29
     */
30
    public function destroy(BatchInteractionRequest $request)
31
    {
32
        return response()->json(Interaction::batchUnlike((array) $request->songs, $request->user()));
33
    }
34
}
35