Passed
Push — master ( d95e49...7c87fb )
by Andrés
39s
created

InstallTask::getComposerOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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\Composer;
12
13
use Symfony\Component\Process\Process;
14
15
/**
16
 * Composer Task - Install Vendors
17
 *
18
 * @author Andrés Montañez <[email protected]>
19
 */
20 View Code Duplication
class InstallTask extends AbstractComposerTask
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 38
    public function getName()
23
    {
24 38
        return 'composer/install';
25
    }
26
27 20
    public function getDescription()
28
    {
29 20
        return '[Composer] Install';
30
    }
31
32 19
    public function execute()
33
    {
34 19
        $options = $this->getOptions();
35 19
        $cmd = sprintf('%s install %s', $options['path'], $options['flags']);
36
37
        /** @var Process $process */
38 19
        $process = $this->runtime->runCommand(trim($cmd), $options['timeout']);
39
40 19
        return $process->isSuccessful();
41
    }
42
43 19
    protected function getComposerOptions()
44
    {
45 19
        return ['flags' => '--optimize-autoloader', 'timeout' => 120];
46
    }
47
}
48