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 Update |
||
6 | * |
||
7 | * ``` php |
||
8 | * <?php |
||
9 | * // simple execution |
||
10 | * $this->taskComposerUpdate()->run(); |
||
11 | * |
||
12 | * // prefer dist with custom path |
||
13 | * $this->taskComposerUpdate('path/to/my/composer.phar') |
||
14 | * ->preferDist() |
||
15 | * ->run(); |
||
16 | * |
||
17 | * // optimize autoloader with custom path |
||
18 | * $this->taskComposerUpdate('path/to/my/composer.phar') |
||
19 | * ->optimizeAutoloader() |
||
20 | * ->run(); |
||
21 | * ?> |
||
22 | * ``` |
||
23 | */ |
||
24 | View Code Duplication | class Update extends Base |
|
0 ignored issues
–
show
|
|||
25 | { |
||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | protected $action = 'update'; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function run() |
||
35 | { |
||
36 | $command = $this->getCommand(); |
||
37 | $this->printTaskInfo('Updating Packages: {command}', ['command' => $command]); |
||
38 | return $this->executeCommand($command); |
||
39 | } |
||
40 | } |
||
41 |
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.