Dump   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 32
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A result() 0 12 1
1
<?php
2
3
namespace League\CLImate\TerminalObject\Basic;
4
5
class Dump extends BasicTerminalObject
6
{
7
    /**
8
     * The data to convert to JSON
9
     *
10
     * @var mixed $data
11
     */
12
    protected $data;
13
14 4
    public function __construct($data)
15
    {
16 4
        $this->data = $data;
17 4
    }
18
19
    /**
20
     * Return the data as JSON
21
     *
22
     * @return string
23
     */
24 4
    public function result()
25
    {
26 4
        ob_start();
27
28 4
        var_dump($this->data);
29
30 4
        $result = ob_get_contents();
31
32 4
        ob_end_clean();
33
34 4
        return $result;
35
    }
36
}
37