OldDirective   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
1
<?php
2
3
namespace EasyBlade\Directives;
4
5
use EasyBlade\Contract\Directivable;
6
7
class OldDirective implements Directivable
8
{
9
    public static function handle($parameter)
10
    {
11
        $array = explode(',', $parameter);
12
        $oldValue = trim($array[0]);
13
        $secondParam = trim(@$array[1]);
14
        if ($secondParam) {
15
            return "<?php echo old({$oldValue}, {$secondParam}) ?>";
16
        }
17
18
        return "<?php echo old({$oldValue}) ?>";
19
    }
20
}