Skip to content

Commit 7640bb8

Browse files
committed
Extract JsonReporter::getOutput from JsonReporter::output.
1 parent 0ce3a8f commit 7640bb8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/PHPSemVerChecker/Reporter/JsonReporter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(Report $report, $path, Filesystem $filesystem = null
3333
$this->filesystem = $filesystem ?: new Filesystem();
3434
}
3535

36-
public function output()
36+
public function getOutput()
3737
{
3838
$output = [];
3939
$output['level'] = Level::toString($this->report->getSuggestedLevel());
@@ -64,6 +64,11 @@ public function output()
6464
}
6565
}
6666

67-
$this->filesystem->write($this->path, json_encode($output, JSON_PRETTY_PRINT));
67+
return $output;
68+
}
69+
70+
public function output()
71+
{
72+
$this->filesystem->write($this->path, json_encode($this->getOutput(), JSON_PRETTY_PRINT));
6873
}
6974
}

0 commit comments

Comments
 (0)