Passed
Push — development ( af9588...0a99ba )
by Mirco
02:26
created

ClearWebCacheCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
1
<?php
2
/***************************************************************************
3
 *  For license information see doc/license.txt
4
 *
5
 *  Unicode Reminder メモ
6
 ***************************************************************************/
7
8
namespace AppBundle\Command;
9
10
use Oc\Cache\WebCache;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
class ClearWebCacheCommand extends AbstractCommand
15
{
16
    const COMMAND_NAME = 'cache:clear-web-cache';
17
18
    /**
19
     * @return void
20
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
21
     */
22
    protected function configure()
23
    {
24
        parent::configure();
25
26
        $this
27
            ->setName(self::COMMAND_NAME)
28
            ->setDescription('clear legacy web caches');
29
    }
30
31
    /**
32
     * @param \Symfony\Component\Console\Input\InputInterface $input
33
     * @param \Symfony\Component\Console\Output\OutputInterface $output
34
     *
35
     * @return int|null
36
     */
37
    protected function execute(InputInterface $input, OutputInterface $output)
38
    {
39
        $output->writeln('Delete cached files');
40
41
        $webCache = new WebCache();
42
        $webCache->clearCache();
43
44
        return self::CODE_SUCCESS;
45
    }
46
}
47