@@ -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 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | try { |
63 | 63 | $file1 = $input->getOption('input1'); |
64 | 64 | $array1 = $parser->parseFile($file1); |
65 | - } catch(\Exception $e) { |
|
65 | + } catch (\Exception $e) { |
|
66 | 66 | $output->writeln('<bg=red;fg=white> ' . $e->getMessage() . ' </>'); |
67 | 67 | return; |
68 | 68 | } |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | $array = $this->merge($array1, $array2); |
79 | 79 | |
80 | 80 | foreach ($array as $key => $value) { |
81 | - if (! isset($value['base'])) { |
|
81 | + if (!isset($value['base'])) { |
|
82 | 82 | $output->writeln('<bg=green;fg=black>+</> ' . $key); |
83 | 83 | continue; |
84 | 84 | } |
85 | - if (! isset($value['current'])) { |
|
85 | + if (!isset($value['current'])) { |
|
86 | 86 | $output->writeln('<bg=red;fg=yellow>-</> ' . $key); |
87 | 87 | continue; |
88 | 88 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $merged[$key]['base'] = $value; |
134 | 134 | } |
135 | 135 | |
136 | - foreach($array2 as $key => $value) { |
|
136 | + foreach ($array2 as $key => $value) { |
|
137 | 137 | $merged[$key]['current'] = $value; |
138 | 138 | } |
139 | 139 |
@@ -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 |
@@ -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 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function getLastLibXmlError() |
40 | 40 | { |
41 | 41 | $error = libxml_get_last_error(); |
42 | - if (! $error instanceof \LibXMLError) { |
|
42 | + if (!$error instanceof \LibXMLError) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function parseFile($filename) |
56 | 56 | { |
57 | - if (! is_readable($filename)) { |
|
57 | + if (!is_readable($filename)) { |
|
58 | 58 | throw new \UnexpectedValueException(sprintf( |
59 | 59 | 'File %s is not readable', |
60 | 60 | basename($filename) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | foreach ($items as $item) { |
79 | 79 | |
80 | 80 | $class = $item->getAttribute('class'); |
81 | - if (! $class) { |
|
81 | + if (!$class) { |
|
82 | 82 | $class = explode('::', $item->parentNode->getAttribute('name'))[0]; |
83 | 83 | } |
84 | 84 |
@@ -41,6 +41,10 @@ |
||
41 | 41 | |
42 | 42 | protected $file2; |
43 | 43 | |
44 | + /** |
|
45 | + * @param string $file1 |
|
46 | + * @param string $file2 |
|
47 | + */ |
|
44 | 48 | public function __construct(StyleInterface $style, $file1, $file2) |
45 | 49 | { |
46 | 50 | $this->style = $style; |