Completed
Push — master ( 7f6ab6...0b9ac4 )
by Arnold
07:54 queued 04:52
created

Twig   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 31
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getViewer() 0 9 2
A createTwigView() 0 4 1
1
<?php
2
3
namespace Jasny\Controller\View;
4
5
use Jasny\Controller\View;
6
use Jasny\View\Twig as TwigView;
7
8
/**
9
 * View using Twig
10
 */
11
trait Twig
12
{
13
    use View;
14
    
15
    /**
16
     * Get the template engine abstraction
17
     * 
18
     * @return TwigView
19
     */
20 1
    public function getViewer()
21
    {
22 1
        if (!isset($this->viewer)) {
23 1
            $this->viewer = $this->createTwigView(['path' => $this->getViewPath()]);
24 1
            $this->viewer->addDefaultExtensions();
0 ignored issues
show
Deprecated Code introduced by
The method Jasny\View\Twig::addDefaultExtensions() has been deprecated.

This method has been deprecated.

Loading history...
25
        }
26
        
27 1
        return $this->viewer;
28
    }
29
    
30
    /**
31
     * Create a twig view object.
32
     * @ignore
33
     * @codeCoverageIgnore
34
     * 
35
     * @return TwigView
36
     */
37
    protected function createTwigView($options)
38
    {
39
        return new TwigView($options);
40
    }
41
}
42