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

PHP::createPHPView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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