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

FlightDamageController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDamagesRepository() 0 3 1
A view() 0 7 1
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
}