LiipImagineCleanupCommand::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 2
eloc 5
nc 2
nop 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