DumpDirective::render()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3.1406

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 10
cc 3
nc 2
nop 0
crap 3.1406
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