Completed
Push — master ( 0945db...0da1a2 )
by Alessandro
12s queued 10s
created

AbstractCommand::getContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Algatux\InfluxDbBundle\Command;
6
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Symfony\Component\Console\Style\SymfonyStyle;
11
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
12
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
13
use Symfony\Component\DependencyInjection\ContainerInterface;
14
15
/**
16
 * Base class for InfluxDbBundle commands.
17
 */
18
abstract class AbstractCommand extends Command implements ContainerAwareInterface
19
{
20
    use ContainerAwareTrait;
21
22
    /**
23
     * @var SymfonyStyle
24
     */
25
    protected $io;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 9
    protected function initialize(InputInterface $input, OutputInterface $output)
31
    {
32 9
        $this->io = new SymfonyStyle($input, $output);
33 9
    }
34
35
    /**
36
     * @return ContainerInterface
37
     */
38 9
    public function getContainer(): ContainerInterface
39
    {
40 9
        return $this->container;
41
    }
42
}
43