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

src/Task/BuiltIn/Composer/InstallTask.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
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