Skip to content

Commit

Permalink
Fix building report's path - closes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenekdrahos committed Jan 12, 2016
1 parent 49c2352 commit 0fc6977
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/CodeAnalysisTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,19 @@ private function buildReport()
foreach ($this->usedTools as $tool => $config) {
if ($config['transformedXml']) {
xmlToHtml(
"{$this->options->buildDir}{$config['transformedXml']}",
$this->options->rawFile($config['transformedXml']),
$this->config->path("report.{$tool}"),
"{$this->options->buildDir}{$tool}.html"
$this->options->rawFile("{$tool}.html")
);
$this->writeHtmlReport("<info>{$this->options->buildDir}{$tool}.html</info>");
$this->writeHtmlReport("<info>{$this->options->rawFile("{$tool}.html")}</info>");
}
}
twigToHtml(
'phpqa.html.twig',
array('tools' => array_keys($this->usedTools)),
"{$this->options->buildDir}phpqa.html"
$this->options->rawFile('phpqa.html')
);
$this->writeHtmlReport("<comment>{$this->options->buildDir}phpqa.html</comment>", true);
$this->writeHtmlReport("<comment>{$this->options->rawFile("phpqa.html")}</comment>", true);
}

// copy-paste from \Robo\Common\TaskIO
Expand Down
7 changes: 6 additions & 1 deletion src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public function filterTools(array $tools)

public function toFile($file)
{
return escapePath("{$this->buildDir}/{$file}");
return escapePath($this->rawFile($file));
}

public function rawFile($file)
{
return "{$this->buildDir}/{$file}";
}
}
1 change: 1 addition & 0 deletions tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function testShouldEscapePaths()
{
assertThat($this->fileOutput->analyzedDir, is('"./"'));
assertThat($this->fileOutput->toFile('file'), is('"build//file"'));
assertThat($this->fileOutput->rawFile('file'), is('build//file'));
}

public function testShouldIgnorePdependInCliOutput()
Expand Down

0 comments on commit 0fc6977

Please sign in to comment.