Passed
Push — master ( 69774c...de7969 )
by Sebastian
02:46
created

NullIO::ask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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
/**
15
 * Class NullIO
16
 *
17
 * @package CaptainHook
18
 * @author  Sebastian Feldmann <[email protected]>
19
 * @link    https://github.com/captainhookphp/captainhook
20
 * @since   Class available since Release 0.9.0
21
 */
22
class NullIO extends Base
23
{
24
    /**
25 1
     * {@inheritDoc}
26
     */
27 1
    public function isInteractive()
28
    {
29
        return false;
30
    }
31
32
    /**
33 1
     * {@inheritDoc}
34
     */
35 1
    public function isVerbose()
36
    {
37
        return false;
38
    }
39
40
    /**
41 1
     * {@inheritDoc}
42
     */
43 1
    public function isVeryVerbose()
44
    {
45
        return false;
46
    }
47
48
    /**
49 1
     * {@inheritDoc}
50
     */
51 1
    public function isDebug()
52
    {
53
        return false;
54
    }
55
56
    /**
57 18
     * {@inheritDoc}
58
     */
59 18
    public function write($messages, $newline = true, $verbosity = self::NORMAL)
60
    {
61
    }
62
63
    /**
64 3
     * {@inheritDoc}
65
     */
66 3
    public function writeError($messages, $newline = true, $verbosity = self::NORMAL)
67
    {
68
    }
69
70
    /**
71 2
     * {@inheritDoc}
72
     */
73 2
    public function ask($question, $default = null)
74
    {
75
        return (string) $default;
76
    }
77
78
    /**
79 1
     * {@inheritDoc}
80
     */
81 1
    public function askConfirmation($question, $default = true)
82
    {
83
        return $default;
84
    }
85
86
    /**
87 1
     * {@inheritDoc}
88
     */
89 1
    public function askAndValidate($question, $validator, $attempts = null, $default = null)
90
    {
91
        return (string) $default;
92
    }
93
}
94