Completed
Branch dev (374206)
by James Ekow Abaka
06:04
created

Smarty::generateFromString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace ntentan\honam\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
    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
        if($this->smarty === null)
19
        {
20
            $this->smarty = new smarty\Engine();
21
        }
22
        $this->smarty->clearAllAssign();
23
        $data['honam'] = $this->getHelpersLoader();
24
        $this->smarty->assign($data);
25
        return $this->smarty;
26
    }
27
    
28
    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
        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