Passed
Push — master ( 1bce37...29d889 )
by Alexis
01:34
created

BaseCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 25
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A initialize() 0 10 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