FindAllSubForumsController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
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