Completed
Push — master ( 4deee6...b383ba )
by Zach
05:43 queued 03:44
created

SymfonyOutput   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A write() 0 6 2
A getOutput() 0 4 1
1
<?php
2
3
namespace Yarak\Console\Output;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
class SymfonyOutput extends Output
8
{
9
    /**
10
     * Symfony command output.
11
     *
12
     * @var OutputInterface
13
     */
14
    protected $output;
15
16
    /**
17
     * Construct.
18
     *
19
     * @param OutputInterface $output
20
     */
21
    public function __construct(OutputInterface $output)
22
    {
23
        $this->output = $output;
24
    }
25
26
    /**
27
     * Write a message.
28
     *
29
     * @param string $message
30
     */
31
    public function write($message)
32
    {
33
        if ($this->verbosity) {
34
            $this->output->writeln($message);
35
        }
36
    }
37
38
    /**
39
     * Get the Symfony output class.
40
     *
41
     * @return OutputInterface
42
     */
43
    public function getOutput()
44
    {
45
        return $this->output;
46
    }
47
}
48