Completed
Pull Request — master (#58)
by Alexis
02:59
created

BaseCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
class BaseCommand extends ContainerAwareCommand
10
{
11
    protected $container;
12
    protected $em;
13
14 9
    protected function configure()
15
    {
16 9
        parent::configure();
17
18
        $this
19 9
            ->setName('statuses:base')
20 9
            ->setDescription('Base command');
21 9
    }
22
23 9
    protected function initialize(InputInterface $input, OutputInterface $output)
24
    {
25 9
        parent::initialize($input, $output); //initialize parent class method
26
27 9
        $this->container = $this->getContainer();
28
29
        // This loads Doctrine, you can load your own services as well
30 9
        $this->em = $this->container->get('doctrine')
31 9
            ->getManager();
32 9
    }
33
}
34