Install::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Robo\Task\Composer;
4
5
/**
6
 * Composer Install
7
 *
8
 * ``` php
9
 * <?php
10
 * // simple execution
11
 * $this->taskComposerInstall()->run();
12
 *
13
 * // prefer dist with custom path
14
 * $this->taskComposerInstall('path/to/my/composer.phar')
15
 *      ->preferDist()
16
 *      ->run();
17
 *
18
 * // optimize autoloader with custom path
19
 * $this->taskComposerInstall('path/to/my/composer.phar')
20
 *      ->optimizeAutoloader()
21
 *      ->run();
22
 * ?>
23
 * ```
24
 */
25 View Code Duplication
class Install extends Base
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...
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected $action = 'install';
31
32
    /**
33
     * adds `no-suggest` option to composer
34
     *
35
     * @param bool $noSuggest
36
     *
37
     * @return $this
38
     */
39
    public function noSuggest($noSuggest = true)
0 ignored issues
show
Unused Code introduced by
The parameter $noSuggest is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
    {
41
        $this->option('--no-suggest');
42
        return $this;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function run()
49
    {
50
        $command = $this->getCommand();
51
        $this->printTaskInfo('Installing Packages: {command}', ['command' => $command]);
52
        return $this->executeCommand($command);
53
    }
54
}
55