IncludeTag   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
namespace Bonfim\Tpl\Tag;
4
5
use Bonfim\Tpl\Tpl;
6
7
class IncludeTag extends Tag
8
{
9
    public function __construct()
10
    {
11
        Tag::match('/@\s*include\s*\(\s*[\'"](.*?)[\'"]\s*\)/', function($file) {
12
13
            $template = str_replace('.', '/', $file);
0 ignored issues
show
Unused Code introduced by
The assignment to $template is dead and can be removed.
Loading history...
14
15
            $content = file_get_contents(Tpl::getDir() . "$file.php");
16
17
            Tag::replace($content);
18
        });
19
    }
20
}
21