IncludeTag::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
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