Completed
Push — master ( 05afa7...403ee9 )
by James Ekow Abaka
04:31
created

Smarty::generateFromString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ntentan\honam\template_engines;
4
5
use ntentan\honam\TemplateEngine;
6
7
/**
8
 * Description of Mustache
9
 *
10
 * @author ekow
11
 */
12
class Smarty extends TemplateEngine
13
{
14
    private $smarty;
15
    
16 2
    private function getSmarty($data)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
17
    {
18 2
        if($this->smarty === null)
19 2
        {
20 2
            $this->smarty = new smarty\Engine();
21 2
        }
22 2
        $this->smarty->clearAllAssign();
23 2
        $data['honam'] = $this->getHelpersLoader();
24 2
        $this->smarty->assign($data);
25 2
        return $this->smarty;
26
    }
27
    
28 2
    protected function generate($data) 
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
29
    {
30 2
        return $this->getSmarty($data)->fetch($this->template);
31
    }
32
33
    protected function generateFromString($string, $data)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
34
    {
35
        return $this->getSmarty($data)->display("string:$string");
36
    }
37
38
}
39