Completed
Push — feature/fixing_cost ( ef981e )
by Laurent
01:53
created

FlightDamageController::getDamagesRepository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
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
        return new GetDamagesForFlightQueryRepository($this->db);
18
    }
19
20
    public function view(){
21
        $flightId = $this->request->getParam('id');
22
23
        return $this->render('flight_damage/view.php', [
24
            'damages' => $this->getDamagesRepository()->__invoke($flightId)
25
        ]);
26
    }
27
}