Completed
Push — master ( d22084...519491 )
by Edson
01:19
created

EvalTag   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handle() 0 3 1
1
<?php
2
3
namespace Sketch\Tpl;
4
5
class EvalTag extends Tag
6
{
7 6
    public function __construct()
8
    {
9 6
        parent::__construct('/{(\s?)+([\w]+)(\s?)+=(\s?)+(.*?)(\s?)+}/is');
10 6
    }
11
    
12 4
    public function handle(array $match): string
13
    {
14 4
        return "<?php \$$match[2] = $match[5] ?>";
15
    }
16
}
17