Completed
Branch master (d1a89c)
by Andrés
05:54
created

CachePoolPruneTask::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 5
cts 5
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * This file is part of the Magallanes package.
4
 *
5
 * (c) Andrés Montañez <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Mage\Task\BuiltIn\Symfony;
12
13
use Symfony\Component\Process\Process;
14
15
/**
16
 * Symfony Task - Cache Pool Prune
17
 *
18
 * @author Andrés Montañez <[email protected]>
19
 */
20 View Code Duplication
class CachePoolPruneTask extends AbstractSymfonyTask
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22 41
    public function getName()
23
    {
24 41
        return 'symfony/cache-pool-prune';
25
    }
26
27 14
    public function getDescription()
28
    {
29 14
        return '[Symfony] Cache Pool Prune';
30
    }
31
32 13
    public function execute()
33
    {
34 13
        $options = $this->getOptions();
35 13
        $command = $options['console'] . ' cache:pool:prune --env=' . $options['env'] . ' ' . $options['flags'];
36
37
        /** @var Process $process */
38 13
        $process = $this->runtime->runCommand(trim($command));
39
40 13
        return $process->isSuccessful();
41
    }
42
}
43