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

ClearWebCacheCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 33
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 9 1
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