LiipImagineCleanupCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 9 2
1
<?php
2
3
namespace Alpixel\Bundle\MediaBundle\Command;
4
5
use Alpixel\Bundle\CronBundle\Annotation\CronJob;
6
use Liip\ImagineBundle\Command\RemoveCacheCommand;
7
use Symfony\Component\Console\Input\ArgvInput;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
11
12
/**
13
 * @CronJob("P7D")
14
 */
15
class LiipImagineCleanupCommand extends RemoveCacheCommand
16
{
17
18
    public function configure()
19
    {
20
        parent::configure();
21
        $this->setName('alpixel:media:liip_cleanup')
22
            ->setDescription('Cleaning liip cache folders');
23
    }
24
25
    public function execute(InputInterface $input, OutputInterface $output)
26
    {
27
        if (count($input->getArguments()) === 0) {
28
            $definition = $this->getDefinition();
29
            $input = new ArgvInput(null, $definition);
30
        }
31
32
        return parent::execute($input, $output);
33
    }
34
}
35