Command   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
c 5
b 0
f 0
lcom 0
cbo 3
dl 0
loc 33
ccs 2
cts 2
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKernel() 0 9 2
A getContainer() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the CLIFramework package.
5
 *
6
 * (c) Arnaud VEBER <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CLIFramework;
13
14
use Symfony\Component\Console\Command\Command as BaseCommand;
15
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
16
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
17
18
/**
19
 *
20
 */
21
class Command extends BaseCommand implements ContainerAwareInterface
22
{
23
    use ContainerAwareTrait;
24
25
    /**
26
     * Get kernel.
27
     *
28
     * @return \Symfony\Component\HttpKernel\KernelInterface
29
     *
30
     * @throws \RuntimeException
31
     *
32
     * @codeCoverageIgnore
33
     */
34
    protected function getKernel()
35
    {
36
        $application = $this->getApplication();
37
        if (!$application instanceof \CLIFramework\Application) {
38
            throw new \RuntimeException('Application should be an instance of \CLIFramework\Application');
39
        }
40
41
        return $application->getKernel();
42
    }
43
44
    /**
45
     * Get Container.
46
     *
47
     * @return \Symfony\Component\DependencyInjection\ContainerInterface
48
     */
49 1
    protected function getContainer()
50
    {
51 1
        return $this->container;
52
    }
53
}
54