CommentsController::showComments()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
4
namespace App\Http\Controllers\Profile;
5
6
7
use App\Http\Controllers\Controller;
8
use App\Src\UseCases\Domain\Context\Queries\GetLastWikiUserComments;
9
use Illuminate\Http\Request;
10
use Illuminate\Support\Facades\Auth;
11
12
class CommentsController extends Controller
13
{
14
    public function showComments(Request $request)
15
    {
16
        $userId = $request->input('user_id');
17
        if (empty($userId))
18
            $userId = Auth::user()->uuid;
19
20
        $comments = app(GetLastWikiUserComments::class)->get($userId);
21
        return view('users.profile.comments', [
22
            'comments' => $comments
23
        ]);
24
    }
25
}
26