Output   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 58
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A writeInfo() 0 3 1
A writeError() 0 3 1
A setVerbosity() 0 5 1
A writeComment() 0 3 1
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