ComposerIO   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 87
ccs 20
cts 20
cp 1
rs 10
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 3 1
A __construct() 0 3 1
A writeError() 0 3 1
A ask() 0 3 1
A isVerbose() 0 3 1
A askAndValidate() 0 3 1
A isInteractive() 0 3 1
A isDebug() 0 3 1
A isVeryVerbose() 0 3 1
A askConfirmation() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Console\IO;
13
14
use Composer\IO\IOInterface;
15
16
/**
17
 * Class ComposerIO
18
 *
19
 * @package CaptainHook
20
 * @author  Sebastian Feldmann <[email protected]>
21
 * @link    https://github.com/captainhook-git/captainhook
22
 * @since   Class available since Release 0.9.0
23
 */
24
class ComposerIO extends Base
25
{
26
    /**
27
     * @var \Composer\IO\IOInterface
28
     */
29
    private $io;
30
31
    /**
32
     * ComposerIO constructor
33
     *
34
     * @param \Composer\IO\IOInterface $io
35
     */
36 9
    public function __construct(IOInterface $io)
37
    {
38 9
        $this->io = $io;
39
    }
40
41
    /**
42
     * {@inheritDoc}
43
     */
44 1
    public function isInteractive()
45
    {
46 1
        return $this->io->isInteractive();
47
    }
48
49
    /**
50
     * {@inheritDoc}
51
     */
52 1
    public function isVerbose()
53
    {
54 1
        return $this->io->isVerbose();
55
    }
56
57
    /**
58
     * {@inheritDoc}
59
     */
60 1
    public function isVeryVerbose()
61
    {
62 1
        return $this->io->isVeryVerbose();
63
    }
64
65
    /**
66
     * {@inheritDoc}
67
     */
68 1
    public function isDebug()
69
    {
70 1
        return $this->io->isDebug();
71
    }
72
73
    /**
74
     * {@inheritDoc}
75
     */
76 1
    public function write($messages, $newline = true, $verbosity = self::NORMAL)
77
    {
78 1
        $this->io->write($messages, $newline, $verbosity);
79
    }
80
81
    /**
82
     * {@inheritDoc}
83
     */
84 1
    public function writeError($messages, $newline = true, $verbosity = self::NORMAL)
85
    {
86 1
        $this->io->writeError($messages, $newline, $verbosity);
87
    }
88
89
    /**
90
     * {@inheritDoc}
91
     */
92 1
    public function ask($question, $default = null)
93
    {
94 1
        return $this->io->ask($question, $default);
95
    }
96
97
    /**
98
     * {@inheritDoc}
99
     */
100 1
    public function askConfirmation($question, $default = true)
101
    {
102 1
        return $this->io->askConfirmation($question, $default);
103
    }
104
105
    /**
106
     * {@inheritDoc}
107
     */
108 1
    public function askAndValidate($question, $validator, $attempts = null, $default = null)
109
    {
110 1
        return $this->io->askAndValidate($question, $validator, $attempts, $default);
111
    }
112
}
113