Completed
Pull Request — master (#13)
by Arnold
07:08
created

PHP::getViewer()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
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 1
        }
25
        
26 1
        return $this->viewer;
27
    }
28
    
29
    /**
30
     * Create a twig view object.
31
     * @ignore
32
     * @codeCoverageIgnore
33
     * 
34
     * @return PHPView;
0 ignored issues
show
Documentation introduced by
The doc-type PHPView; could not be parsed: Expected "|" or "end of type", but got ";" at position 7. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
35
     */
36
    protected function createPHPView($options)
37
    {
38
        return new PHPView($options);
39
    }
40
}
41