ClearCacheTask::getOptionParser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace App\Shell\Task;
3
4
use Cake\Cache\Cache;
5
use Cake\Console\ConsoleOptionParser;
6
use Cake\Console\Shell;
7
8
class ClearCacheTask extends Shell
9
{
10
    /**
11
     * Execute the ClearCache task.
12
     *
13
     * @return void
14
     */
15
    public function main()
16
    {
17
        Cache::clear(false, '_cake_core_');
18
        Cache::clear(false, 'database');
19
        Cache::clear(false, 'statistics');
20
        Cache::clear(false, 'acl');
21
        $this->out('<info>The</info> "<error>deployer clear_cache</error>" <info>command has been executed successfully !</info>', 2);
22
    }
23
24
    /**
25
     * Display help for this console.
26
     *
27
     * @return ConsoleOptionParser
28
     */
29
    public function getOptionParser()
30
    {
31
        $parser = new ConsoleOptionParser('clear_cache', false);
32
        $parser->description(
0 ignored issues
show
Deprecated Code introduced by
The method Cake\Console\ConsoleOptionParser::description() has been deprecated with message: 3.4.0 Use setDescription()/getDescription() instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
33
            'This task is used to clear the cached files in the application.'
34
        );
35
36
        return $parser;
37
    }
38
}
39