@@ -37,12 +37,12 @@ |
||
37 | 37 | protected function configure() |
38 | 38 | { |
39 | 39 | $this->setName('diff') |
40 | - ->setDescription('Shows a diff between two JUnit log files') |
|
41 | - ->setDefinition(array( |
|
42 | - new InputOption('input1', '1', InputOption::VALUE_REQUIRED, 'First input file'), |
|
43 | - new InputOption('input2', '2', InputOption::VALUE_REQUIRED, 'Second input file') |
|
44 | - )) |
|
45 | - ->setHelp(''); |
|
40 | + ->setDescription('Shows a diff between two JUnit log files') |
|
41 | + ->setDefinition(array( |
|
42 | + new InputOption('input1', '1', InputOption::VALUE_REQUIRED, 'First input file'), |
|
43 | + new InputOption('input2', '2', InputOption::VALUE_REQUIRED, 'Second input file') |
|
44 | + )) |
|
45 | + ->setHelp(''); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | try { |
57 | 57 | $file1 = $input->getOption('input1'); |
58 | 58 | $array1 = $this->parseJunitFile($file1); |
59 | - } catch(\Exception $e) { |
|
59 | + } catch (\Exception $e) { |
|
60 | 60 | $output->writeln('<bg=red;fg=white> ' . $e->getMessage() . ' </>'); |
61 | 61 | return; |
62 | 62 | } |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | $array = $this->merge($array1, $array2); |
73 | 73 | |
74 | 74 | foreach ($array as $key => $value) { |
75 | - if (! isset($value['base'])) { |
|
75 | + if (!isset($value['base'])) { |
|
76 | 76 | $output->writeln('<bg=green;fg=black>+</> ' . $key); |
77 | 77 | continue; |
78 | 78 | } |
79 | - if (! isset($value['current'])) { |
|
79 | + if (!isset($value['current'])) { |
|
80 | 80 | $output->writeln('<bg=red;fg=yellow>-</> ' . $key); |
81 | 81 | continue; |
82 | 82 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $merged[$key]['base'] = $value; |
128 | 128 | } |
129 | 129 | |
130 | - foreach($array2 as $key => $value) { |
|
130 | + foreach ($array2 as $key => $value) { |
|
131 | 131 | $merged[$key]['current'] = $value; |
132 | 132 | } |
133 | 133 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | protected function parseJunitFile($filename) |
140 | 140 | { |
141 | - if (! is_readable($filename)) { |
|
141 | + if (!is_readable($filename)) { |
|
142 | 142 | throw new \UnexpectedValueException(sprintf( |
143 | 143 | 'File %s is not readable', |
144 | 144 | basename($filename) |
@@ -42,9 +42,9 @@ |
||
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @param array $array1 |
45 | - * @param array $array26 |
|
45 | + * @param array $array2 |
|
46 | 46 | * |
47 | - * @return array |
|
47 | + * @return MergeResult |
|
48 | 48 | */ |
49 | 49 | public function merge(array $array1, array $array2) |
50 | 50 | { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $this->mergeResult->addBase($key, $value); |
54 | 54 | } |
55 | 55 | |
56 | - foreach($array2 as $key => $value) { |
|
56 | + foreach ($array2 as $key => $value) { |
|
57 | 57 | $this->mergeResult->addCurrent($key, $value); |
58 | 58 | } |
59 | 59 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function parseFile($filename) |
40 | 40 | { |
41 | - if (! is_readable($filename)) { |
|
41 | + if (!is_readable($filename)) { |
|
42 | 42 | throw new \UnexpectedValueException(sprintf( |
43 | 43 | 'File %s is not readable', |
44 | 44 | basename($filename) |
@@ -47,11 +47,11 @@ |
||
47 | 47 | $mergeResult->sort(); |
48 | 48 | |
49 | 49 | foreach ($mergeResult as $key => $value) { |
50 | - if (! isset($value['base'])) { |
|
50 | + if (!isset($value['base'])) { |
|
51 | 51 | $this->style->text('<bg=green;fg=black>+</> ' . $key); |
52 | 52 | continue; |
53 | 53 | } |
54 | - if (! isset($value['current'])) { |
|
54 | + if (!isset($value['current'])) { |
|
55 | 55 | $this->style->text('<bg=red;fg=yellow>-</> ' . $key); |
56 | 56 | continue; |
57 | 57 | } |
@@ -47,12 +47,12 @@ |
||
47 | 47 | protected function configure() |
48 | 48 | { |
49 | 49 | $this->setName('compare') |
50 | - ->setDescription('Compares two JUnit log files') |
|
51 | - ->setDefinition(array( |
|
52 | - new InputArgument('base', InputArgument::REQUIRED, 'Base file for the comparison'), |
|
53 | - new InputArgument('current', InputArgument::REQUIRED, 'Current file to compare against the base file') |
|
54 | - )) |
|
55 | - ->setHelp(''); |
|
50 | + ->setDescription('Compares two JUnit log files') |
|
51 | + ->setDefinition(array( |
|
52 | + new InputArgument('base', InputArgument::REQUIRED, 'Base file for the comparison'), |
|
53 | + new InputArgument('current', InputArgument::REQUIRED, 'Current file to compare against the base file') |
|
54 | + )) |
|
55 | + ->setHelp(''); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 |