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

PHP   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
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 30
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getViewer() 0 8 2
A createPHPView() 0 4 1
1
<?php
2
3
namespace Jasny\Controller\View;
4
5
use Jasny\Controller\View;
6
use Jasny\View\PHP as PHPView;
7
8
/**
9
 * View using PHP
10
 */
11
trait PHP
12
{
13
    use View;
14
    
15
    /**
16
     * Get the template engine abstraction
17
     * 
18
     * @return PHPView
19
     */
20 1
    public function getViewer()
21
    {
22 1
        if (!isset($this->viewer)) {
23 1
            $this->viewer = $this->createPHPView(['path' => $this->getViewPath()]);
24
        }
25
        
26 1
        return $this->viewer;
27
    }
28
    
29
    /**
30
     * Create a twig view object.
31
     * @ignore
32
     * @codeCoverageIgnore
33
     * 
34
     * @return PHPView
35
     */
36
    protected function createPHPView($options)
37
    {
38
        return new PHPView($options);
39
    }
40
}
41