Completed
Branch master (1439d8)
by Benjamin
03:26 queued 01:05
created

CacheFlushTask::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the teamneusta/magallanes-task-typo3 package.
4
 *
5
 * Copyright (c) 2017 neusta GmbH | Ein team neusta Unternehmen
6
 *
7
 * For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
8
 *
9
 * @license http://www.opensource.org/licenses/mit-license.html  MIT License
10
 */
11
declare(strict_types=1);
12
13
namespace TeamNeusta\Magallanes\Task\TYPO3\Console;
14
15
/**
16
 * Class CacheFlushTask
17
 *
18
 * @author Benjamin Kluge <[email protected]>
19
 * @package TeamNeusta\Magallanes\Task\TYPO3\Console
20
 */
21
class CacheFlushTask extends AbstractConsoleTask
22
{
23
    /**
24
     * name
25
     *
26
     * @var string
27
     */
28
    protected $name = 'console-cache-flush';
29
30
    /**
31
     * description
32
     *
33
     * @var string
34
     */
35
    protected $description = '[TYPO3] TYPO3 console cache task';
36
37
    /**
38
     * execute
39
     *
40
     * @return bool
41
     */
42
    public function execute(): bool
43
    {
44
        $options = $this->getOptions(
45
            [
46
                'force-flush-cache' => null
47
            ]
48
        );
49
        $command = sprintf(
50
            $this->getConsoleCommand('cache:flush', $options).'%s',
51
            !empty($options['force-flush-cache']) ? 'true' : ''
52
        );
53
54
        return $this->executeCommand($command);
55
    }
56
}
57