Passed
Push — dev ( 191906...4ff9c3 )
by James Ekow Abaka
02:16
created

Core   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 22
ccs 8
cts 12
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 4 1
A __construct() 0 5 1
A __destruct() 0 4 3
1
<?php
2
namespace ntentan\honam\engines\smarty;
3
4
use ntentan\honam\factories\HelperVariable;
0 ignored issues
show
Bug introduced by
The type ntentan\honam\factories\HelperVariable was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use ntentan\honam\TemplateRenderer;
6
use ntentan\utils\Filesystem;
7
use Smarty;
8
9
class Core extends Smarty
10
{
11
    private $temp = '.';
12
13 1
    public function __construct(string $tempDirectory)
14
    {
15 1
        parent::__construct();
16 1
        $this->temp = $tempDirectory;
17 1
        $this->setCompileDir("{$this->temp}/smarty_compiled_templates");
18 1
    }
19
    
20
    public function __destruct() 
21
    {
22
        if($this->temp === '.' && file_exists("./smarty_compiled_templates")) {
23
            Filesystem::get("./smarty_compiled_templates")->delete();
24
        }
25
    }
26
27 1
    public function setData($data)
28
    {
29 1
        $this->clearAllAssign();
30 1
        $this->assign($data);
31 1
    }
32
}
33