Completed
Push — feature/pilot_information ( 13ff1e...cc067b )
by Laurent
01:46
created

PilotListController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 8 1
A getPilotRepository() 0 4 1
1
<?php
2
3
4
namespace FlightLog\Http\Web\Controller;
5
6
7
use FlightLog\Application\Pilot\Command\CreateUpdatePilotInformationCommand;
8
use FlightLog\Application\Pilot\Command\CreateUpdatePilotInformationCommandHandler;
9
use FlightLog\Domain\Pilot\ValueObject\PilotId;
10
use FlightLog\Http\Web\Form\PilotForm;
11
use FlightLog\Infrastructure\Pilot\Query\Repository\PilotQueryRepository;
12
use FlightLog\Infrastructure\Pilot\Repository\PilotRepository;
13
14
final class PilotListController extends WebController
15
{
16
17
    public function index(){
18
19
        $members = $this->getPilotRepository()->query();
20
21
        return $this->render('pilot/index.phtml', [
22
            'members' => $members,
23
        ]);
24
    }
25
26
    private function getPilotRepository(): PilotQueryRepository
27
    {
28
        return new PilotQueryRepository($this->db);
29
    }
30
}