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

Output   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
write() 0 1 ?
A writeInfo() 0 4 1
A writeError() 0 4 1
A writeComment() 0 4 1
A setVerbosity() 0 6 1
1
<?php
2
3
namespace Yarak\Console\Output;
4
5
abstract class Output
6
{
7
    /**
8
     * Output verbosity.
9
     *
10
     * @var bool
11
     */
12
    protected $verbosity = true;
13
14
    /**
15
     * Write a message.
16
     *
17
     * @param string $message
18
     */
19
    abstract public function write($message);
20
21
    /**
22
     * Write an info message.
23
     *
24
     * @param string $message
25
     */
26
    public function writeInfo($message)
27
    {
28
        $this->write("<info>{$message}</info>");
29
    }
30
31
    /**
32
     * Write an error message.
33
     *
34
     * @param string $message
35
     */
36
    public function writeError($message)
37
    {
38
        $this->write("<error>{$message}</error>");
39
    }
40
41
    /**
42
     * Write a comment message.
43
     *
44
     * @param string $message
45
     */
46
    public function writeComment($message)
47
    {
48
        $this->write("<comment>{$message}</comment>");
49
    }
50
51
    /**
52
     * Set the output verbosity.
53
     *
54
     * @param bool $verbosity
55
     *
56
     * @return $this
57
     */
58
    public function setVerbosity($verbosity)
59
    {
60
        $this->verbosity = $verbosity;
61
62
        return $this;
63
    }
64
}
65