NoOutputFormatter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isValidDataType() 0 4 1
A validate() 0 4 1
A write() 0 3 1
1
<?php
2
namespace Consolidation\OutputFormatters\Formatters;
3
4
use Consolidation\OutputFormatters\Validate\ValidationInterface;
5
use Consolidation\OutputFormatters\Options\FormatterOptions;
6
use Consolidation\OutputFormatters\Validate\ValidDataTypesTrait;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
/**
10
 * No output formatter
11
 *
12
 * This formatter never produces any output. It is useful in cases where
13
 * a command should not produce any output by default, but may do so if
14
 * the user explicitly includes a --format option.
15
 */
16
class NoOutputFormatter implements FormatterInterface, ValidationInterface
17
{
18
    /**
19
     * All data types are acceptable.
20
     */
21
    public function isValidDataType(\ReflectionClass $dataType)
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function validate($structuredData)
30
    {
31
        return $structuredData;
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function write(OutputInterface $output, $data, FormatterOptions $options)
38
    {
39
    }
40
}
41