InstallCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 19 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
	$this->setName('install')
21
		->setDescription('Install project, up migration and seeds');
22
    }
23
24
    protected function execute(InputInterface $input, OutputInterface $output){
25
26
	$command	 = $this->getApplication()->find('config:convert');
27
	$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...
28
	    'command' => 'config:convert'
29
		]), $output);
30
31
	$command	 = $this->getApplication()->find('packages:install');
32
	$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...
33
	    'command' => 'packages:install'
34
		]), $output);
35
36
	$command	 = $this->getApplication()->find('migration:migrate');
37
	$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...
38
	    'command' => 'migration:migrate'
39
		]), $output);
40
41
	$output->writeln("install completed!");
42
    }
43
}
44