CacheVersionCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 9 1
1
<?php
2
3
namespace Browscap\BrowscapBundle\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 CacheVersionCommand extends ContainerAwareCommand
10
{
11
    protected function configure()
12
    {
13
        $this
14
            ->setName('browscap:cache_version')
15
            ->setDescription('Indicates the version of the cache used by Browscap')
16
        ;
17
    }
18
19
    protected function execute(InputInterface $input, OutputInterface $output)
20
    {
21
        $bc = $this->getContainer()->get('browscap');
22
23
        //Needed to load cache and get cache version
24
        $bc->getBrowser("");
25
26
        $output->writeln($bc->getSourceVersion());
27
    }
28
}
29