DumpDirective   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 2
b 0
f 0
dl 0
loc 11
ccs 3
cts 4
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 8 3
1
<?php
2
3
namespace Bavix\Flow\Directives;
4
5
use Bavix\Flow\Directive;
6
7
class DumpDirective extends Directive
8
{
9
10 1
    public function render(): string
11
    {
12 1
        if (PHP_SAPI !== 'cli' && class_exists(\Symfony\Component\VarDumper\VarDumper::class))
13
        {
14
            return '<?php \Symfony\Component\VarDumper\VarDumper::dump(' . $this->data['args']['code'] . '); ?>';
15
        }
16
17 1
        return '<?php var_dump(' . $this->data['args']['code'] . '); ?>';
18
    }
19
20
}
21