Completed
Push — master ( e65d6e...357eb6 )
by dima
03:55
created

InstallCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
A execute() 0 20 1
1
<?php
2
namespace Frameworkless\Console\Commands;
3
4
use Symfony\Component\Console\Command\Command;
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use Symfony\Component\Console\Input\StringInput;
8
use Symfony\Component\Console\Input\ArrayInput;
9
use Symfony\Component\Process\Process;
10
use Symfony\Component\Process\Exception\ProcessFailedException;
11
12
/**
13
 * Description of HelloWorldCommand
14
 *
15
 * @author Dmitriy
16
 */
17
class InstallCommand extends Command
18
{
19
    protected function configure()
20
    {
21
        $this->setName('install')
22
            ->setDescription('Install project, up migration and seeds');
23
    }
24
25
    protected function execute(InputInterface $input, OutputInterface $output)
26
    { 
27
		
28
		$command	 = $this->getApplication()->find('config:convert');
29
		$returnCode	 = $command->run(new ArrayInput([
0 ignored issues
show
Unused Code introduced by
$returnCode is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
30
				'command'	 => 'config:convert'
31
		]), $output);
32
		
33
		$command	 = $this->getApplication()->find('packages:install');
34
		$returnCode	 = $command->run(new ArrayInput([
0 ignored issues
show
Unused Code introduced by
$returnCode is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
35
				'command'	 => 'packages:install'
36
		]), $output);
37
38
		$command	 = $this->getApplication()->find('migration:migrate');
39
		$returnCode	 = $command->run(new ArrayInput([
0 ignored issues
show
Unused Code introduced by
$returnCode is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
40
				'command'	 => 'migration:migrate'
41
		]), $output);		
42
43
		$output->writeln("install completed!");
44
    }
45
}
46