AbstractConsoleWriter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A writeText() 0 4 1
A writeLine() 0 4 1
A writeEOL() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\writer;
13
14
15
/**
16
 * Class AbstractConsoleWriter
17
 * @package cloak\writer
18
 */
19
abstract class AbstractConsoleWriter implements StdoutWriter
20
{
21
22
    /**
23
     * @var \Zend\Console\Adapter\AdapterInterface
24
     */
25
    protected $console;
26
27
28
    /**
29
     * @{inheritDoc}
30
     */
31
    public function writeText($text, $color = null, $bgColor = null)
32
    {
33
        $this->console->writeText($text, $color, $bgColor);
34
    }
35
36
    /**
37
     * @{inheritDoc}
38
     */
39
    public function writeLine($text = "", $color = null, $bgColor = null)
40
    {
41
        $this->console->writeLine($text, $color, $bgColor);
42
    }
43
44
    /**
45
     * @{inheritDoc}
46
     */
47
    public function writeEOL()
48
    {
49
        $this->console->writeLine('');
50
    }
51
52
}
53