Completed
Push — master ( 5b4c10...526034 )
by Benjamin
04:25
created

InstallGeneratePackagestatesTask   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 36
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 14 14 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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 GeneratepackagestatesTask
17
 *
18
 * @author Benjamin Kluge <[email protected]>
19
 * @package TeamNeusta\Magallanes\Task\TYPO3\Console
20
 */
21 View Code Duplication
class InstallGeneratePackagestatesTask extends AbstractConsoleTask
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...
22
{
23
    /**
24
     * name
25
     *
26
     * @var string
27
     */
28
    protected $name = 'console-install-generate-packagestates';
29
30
    /**
31
     * description
32
     *
33
     * @var string
34
     */
35
    protected $description = '[TYPO3] TYPO3 console install generate packagestates task';
36
37
    /**
38
     * execute
39
     *
40
     * @return bool
41
     */
42
    public function execute(): bool
43
    {
44
        $options = $this->getOptions(
45
            [
46
                'flags' => '--activate-default=true'
47
            ]
48
        );
49
        $command = sprintf(
50
            $this->getConsoleCommand('install:generatepackagestates', $options) . '%s',
51
            $options['flags']
52
        );
53
54
        return $this->executeCommand($command);
55
    }
56
}
57