Completed
Push — master ( 069124...27e495 )
by Edson
02:00
created

IncludeTag   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
1
<?php
2
3
namespace Sketch\Tpl\Tag;
4
5
class IncludeTag extends Tag
6
{
7 2
    public function __construct()
8
    {
9 2
        $search = "/{(\s?)+include(\s?)+[\"']([\w\.]+)[\"'](\s?)+}/is";
10
11
        Tag::match($search, function($template) {
12
13
            $template = str_replace('.', '/', $template);
14
15
            $path    = self::$config['template_dir'];
16
            $content = file_get_contents("$path/$template.html");
17
18
            Tag::replace($content);
19 2
        });
20 2
    }
21
}
22