Completed
Push — master ( 2edeb4...8f93c5 )
by Albert
03:04
created

AbstractController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setTwig() 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
    /**
15
     * {@inheritdoc}
16
     */
17
    public function setTwig(Twig_Environment $twig)
18
    {
19
        $this->twig = $twig;
20
    }
21
22
    /**
23
     * @param string $name View name
24
     * @param array  $data Data sent to view
25
     *
26
     * @return string
27
     */
28
    protected function view($name, $data = [])
29
    {
30
        return $this->twig->render($name, $data);
31
    }
32
}
33