Test Failed
Push — master ( e387ef...0464de )
by Lexey
03:14
created

ConsoleIO::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace LF\EnvDiff\IO;
4
5
use Symfony\Component\Console\Helper\QuestionHelper;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Console\Question\Question;
9
10
/**
11
 * @codeCoverageIgnore
12
 */
13
class ConsoleIO implements IOInterface
14
{
15
    /** @var InputInterface */
16
    private $input;
17
18
    /** @var OutputInterface */
19
    private $output;
20
21
    /** @var QuestionHelper */
22
    private $questionHelper;
23
24
    /**
25
     * ConsoleIO constructor.
26
     *
27
     * @param InputInterface  $input
28
     * @param OutputInterface $output
29
     */
30
    public function __construct(InputInterface $input, OutputInterface $output)
31
    {
32
        $this->input          = $input;
33
        $this->output         = $output;
34
        $this->questionHelper = new QuestionHelper();
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function write($message)
41
    {
42
        $this->output->writeln($message);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function isInteractive()
49
    {
50
        $this->input->isInteractive();
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function ask($question, $default = null)
57
    {
58
        return $this->questionHelper->ask($this->input, $this->output, new Question($question, $default));
59
    }
60
}
61