Completed
Pull Request — master (#65)
by
unknown
01:42
created

VarDumpFormatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A write() 0 8 1
1
<?php
2
3
namespace Consolidation\OutputFormatters\Formatters;
4
5
use Consolidation\OutputFormatters\Options\FormatterOptions;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use Symfony\Component\VarDumper\Cloner\VarCloner;
8
use Symfony\Component\VarDumper\Dumper\CliDumper;
9
10
/**
11
 * Var_dump formatter
12
 *
13
 * Run provided data through Symfony VarDumper component.
14
 */
15
class VarDumpFormatter implements FormatterInterface
16
{
17
    /**
18
     * @inheritdoc
19
     */
20
    public function write(OutputInterface $output, $data, FormatterOptions $options)
21
    {
22
        /** @var \Symfony\Component\Console\Output\StreamOutput $output */
23
        (new CliDumper())->dump(
24
            (new VarCloner())->cloneVar($data),
25
            $output->getStream()
26
        );
27
    }
28
}
29