LiipImagineCleanupCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
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