Skip to content

Commit

Permalink
bug fix for empty template
Browse files Browse the repository at this point in the history
  • Loading branch information
spl1nes committed Oct 19, 2019
1 parent e2d11db commit 3c0900b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Application/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public function __construct(array $argv)

if (isset($help) || !isset($destination) || !isset($testLog) || !isset($langArray)) {
$this->printUsage();

return;
}

$destination = \rtrim($destination, '/\\');
$testLog = \rtrim($testLog, '/\\');
$langArray = \rtrim($langArray, '/\\');
Expand Down
6 changes: 3 additions & 3 deletions src/Application/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function createReport() : void
$this->createBaseFiles();

$testView = new TestView();
$testView->setTemplate(!\realpath($this->template) || !\file_exists($this->template . '/index.tpl.php') ? __DIR__ . '/../../Theme/index' : $this->template . '/index');
$testView->setTemplate($this->template === null || !\realpath($this->template) || !\file_exists($this->template . '/index.tpl.php') ? __DIR__ . '/../../Theme/index' : $this->template . '/index');

$this->handleCmdData($testView);

Expand Down Expand Up @@ -207,14 +207,14 @@ private function handleCoverage(array &$testReportData, $dom, $testView) : void

private function createOutputDir() : void
{
if (!\file_exists($this->destiation)) {
if (!\file_exists($this->destination)) {
\mkdir($this->destination, 0777, true);
}
}

private function createBaseFiles() : void
{
$path = !\realpath($this->template) || !\file_exists($this->template . '/index.tpl.php') ? __DIR__ . '/../../Theme' : $this->template;
$path = $this->template === null || !\realpath($this->template) || !\file_exists($this->template . '/index.tpl.php') ? __DIR__ . '/../../Theme' : $this->template;
$this->recursiveCopy($path, $this->destination);
}

Expand Down

0 comments on commit 3c0900b

Please sign in to comment.