UpdateCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace Magestead\Command;
3
4
use Symfony\Component\Console\Command\Command;
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
/**
9
 * Class UpdateCommand
10
 * @package Magestead\Command
11
 */
12 View Code Duplication
class UpdateCommand extends Command
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...
13
{
14
    private $projectPath;
15
16
    /**
17
     * Configure the command and description
18
     */
19
    public function configure()
20
    {
21
        $this->projectPath = getcwd();
22
23
        $this->setName("self-update");
24
        $this->setDescription("Check for new updates for Magestead CLI");
25
    }
26
27
    /**
28
     * Execute a global composer update for the package
29
     *
30
     * @param InputInterface $input
31
     * @param OutputInterface $output
32
     * @return ProcessCommand
33
     */
34
    protected function execute(InputInterface $input, OutputInterface $output)
35
    {
36
        $output->writeln('<info>Checking for Updates</info>');
37
        return new ProcessCommand('composer global update richdynamix/magestead', $this->projectPath, $output);
38
    }
39
}