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

WebController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A render() 0 8 2
1
<?php
2
3
4
namespace FlightLog\Http\Web\Controller;
5
6
7
use FlightLog\Http\Web\Requests\Request;
8
9
abstract class WebController
10
{
11
    /**
12
     * @var \DoliDB
13
     */
14
    protected $db;
15
16
    /**
17
     * @var Request
18
     */
19
    protected $request;
20
21
    public function __construct(\DoliDB $db)
22
    {
23
        $this->db = $db;
24
        $this->request = new Request();
25
    }
26
27
    protected function render($view, array $variables = []){
28
29
        foreach($variables as $variableName => $variableValue){
30
            $GLOBALS[$variableName] = $variableValue;
31
        }
32
33
        return include __DIR__.'/../templates/'.$view;
34
    }
35
36
}