Dumper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A dump() 0 10 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: lenovo
5
 * Date: 6/18/2018
6
 * Time: 11:16 PM
7
 */
8
9
namespace TimSDK\Support;
10
11
use Symfony\Component\VarDumper\Cloner\VarCloner;
12
use Symfony\Component\VarDumper\Dumper\CliDumper;
13
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
14
15
class Dumper
16
{
17
    /**
18
     * Dump a value with elegance.
19
     *
20
     * @param $value
21
     * @return void
22
     */
23
    public function dump($value)
24
    {
25
        if (class_exists(CliDumper::class)) {
26
            $dumper = in_array(PHP_SAPI, ['cli', 'phpdpg']) ? new CliDumper : new HtmlDumper;
27
28
            $dumper->dump((new VarCloner)->cloneVar($value));
29
        } else {
30
            var_dump($value);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($value); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
31
        }
32
    }
33
}
34