FindAllSubForumsController::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace App\Http\Controllers\SubForums;
6
7
use App\Http\Controllers\Controller;
8
use Illuminate\Http\JsonResponse;
9
use TrophyForum\SubForums\Application\FindAll\FindAllSubForumsQuery;
10
use TrophyForum\SubForums\Application\FindAll\FindAllSubForumsQueryHandler;
11
12
final class FindAllSubForumsController extends Controller
13
{
14
    public function __invoke(): JsonResponse
15
    {
16
        $this->bus->addHandler(FindAllSubForumsQuery::class, FindAllSubForumsQueryHandler::class);
17
18
        return JsonResponse::create(
19
            $this->bus->dispatch(new FindAllSubForumsQuery())
20
        );
21
    }
22
}
23