Skip to content

Commit

Permalink
Extract JsonReporter::getOutput from JsonReporter::output.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzx committed Mar 21, 2015
1 parent 0ce3a8f commit 7640bb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/PHPSemVerChecker/Reporter/JsonReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(Report $report, $path, Filesystem $filesystem = null
$this->filesystem = $filesystem ?: new Filesystem();
}

public function output()
public function getOutput()
{
$output = [];
$output['level'] = Level::toString($this->report->getSuggestedLevel());
Expand Down Expand Up @@ -64,6 +64,11 @@ public function output()
}
}

$this->filesystem->write($this->path, json_encode($output, JSON_PRETTY_PRINT));
return $output;
}

public function output()
{
$this->filesystem->write($this->path, json_encode($this->getOutput(), JSON_PRETTY_PRINT));
}
}

0 comments on commit 7640bb8

Please sign in to comment.