Output::writeComment()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Artisanize\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