Completed
Push — master ( 2b894b...836484 )
by Gaetano
05:34
created

ConsoleIO::getInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\Core\Helper;
4
5
use Symfony\Component\Console\Event\ConsoleCommandEvent;
6
7
/**
8
 * 'Saves' the console IO channels to make them available to whoever needs them, eg. kinky php migrations...
9
 */
10
class ConsoleIO
11
{
12
    protected $input;
13
    protected $output;
14
15
    public function onConsoleCommand(ConsoleCommandEvent $event) {
16
        $this->input = $event->getInput();
17
        $this->output = $event->getOutput();
18
    }
19
20
    /**
21
     * NB: will return NULL when called from anything else but a console application context!
22
     * @return \Symfony\Component\Console\Input\InputInterface
23
     */
24
    public function getInput()
25
    {
26
        return $this->input;
27
    }
28
29
    /**
30
     * NB: will return NULL when called from anything else but a console application context!
31
     * @return \Symfony\Component\Console\Output\OutputInterface
32
     */
33
    public function getOutput()
34
    {
35
        return $this->output;
36
    }
37
}
38