Completed
Push — master ( 8b8afe...5f2bbe )
by Greg
02:21
created

src/Task/Composer/Remove.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
namespace Robo\Task\Composer;
3
4
/**
5
 * Composer Remove
6
 *
7
 * ``` php
8
 * <?php
9
 * // simple execution
10
 * $this->taskComposerRemove()->run();
11
 * ?>
12
 * ```
13
 */
14 View Code Duplication
class Remove extends Base
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...
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected $action = 'remove';
20
21
    /**
22
     * @return $this
23
     */
24
    public function dev($dev = true)
25
    {
26
        if ($dev) {
27
            $this->option('--dev');
28
        }
29
        return $this;
30
    }
31
32
    /**
33
     * @return $this
34
     */
35
    public function noProgress($noProgress = true)
36
    {
37
        if ($noProgress) {
38
            $this->option('--no-progress');
39
        }
40
        return $this;
41
    }
42
43
    /**
44
     * @return $this
45
     */
46
    public function noUpdate($noUpdate = true)
47
    {
48
        if ($noUpdate) {
49
            $this->option('--no-update');
50
        }
51
        return $this;
52
    }
53
54
    /**
55
     * @return $this
56
     */
57
    public function updateNoDev($updateNoDev = true)
58
    {
59
        if ($updateNoDev) {
60
            $this->option('--update-no-dev');
61
        }
62
        return $this;
63
    }
64
65
    /**
66
     * @return $this
67
     */
68
    public function noUpdateWithDependencies($updateWithDependencies = true)
69
    {
70
        if ($updateWithDependencies) {
71
            $this->option('--no-update-with-dependencies');
72
        }
73
        return $this;
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public function run()
80
    {
81
        $command = $this->getCommand();
82
        $this->printTaskInfo('Removing packages: {command}', ['command' => $command]);
83
        return $this->executeCommand($command);
84
    }
85
}
86