ContainerAwareCommand::setContainer()   A
last analyzed

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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Comrade42\PhpBBParser\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
/**
10
 * Class ContainerAwareCommand
11
 * @package Comrade42\PhpBBParser\Command
12
 */
13
abstract class ContainerAwareCommand extends Command implements ContainerAwareInterface
14
{
15
    /**
16
     * @var ContainerInterface
17
     */
18
    protected $container;
19
20
    /**
21
     * @param ContainerInterface $container
22
     * @param string|null $name
23
     */
24
    public function __construct(ContainerInterface $container, $name = null)
25
    {
26
        parent::__construct($name);
27
28
        $this->setContainer($container);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function setContainer(ContainerInterface $container = null)
35
    {
36
        $this->container = $container;
37
    }
38
}
39