Completed
Push — feature/fixing_cost ( f58af6...414fbf )
by Laurent
01:41
created

FlightDamageController::getInvoiceDamageCommandHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace FlightLog\Http\Web\Controller;
5
6
7
use FlightLog\Application\Damage\Query\GetDamagesForFlightQueryRepositoryInterface;
8
use FlightLog\Infrastructure\Damage\Query\Repository\GetDamagesForFlightQueryRepository;
9
10
final class FlightDamageController extends WebController
11
{
12
13
    /**
14
     * @return GetDamagesForFlightQueryRepositoryInterface
15
     */
16
    private function getDamagesRepository()
17
    {
18
        return new GetDamagesForFlightQueryRepository($this->db);
19
    }
20
21
    public function view()
22
    {
23
        $flightId = $this->request->getParam('id');
24
25
        $this->render('flight_damage/view.php', [
26
            'damages' => $this->getDamagesRepository()->__invoke($flightId),
27
            'flightId' => $flightId,
28
        ]);
29
    }
30
}