Completed
Push — master ( 12d04d...f0be6a )
by Albert
02:59
created

AbstractController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 2
c 3
b 0
f 2
lcom 1
cbo 1
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A view() 0 4 1
1
<?php
2
3
namespace Albert221\Blog\Controller;
4
5
use Twig_Environment;
6
7
abstract class AbstractController
8
{
9
    /**
10
     * @var Twig_Environment Twig
11
     */
12
    protected $twig;
13
14
    public function __construct(Twig_Environment $twig)
15
    {
16
        $this->twig = $twig;
17
    }
18
19
    /**
20
     * @param string $name View name
21
     * @param array  $data Data sent to view
22
     *
23
     * @return string
24
     */
25
    protected function view($name, $data = [])
26
    {
27
        return $this->twig->render($name, $data);
28
    }
29
}
30