Skip to content

Commit

Permalink
only use needed properties
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 7, 2024
1 parent d6313ed commit d4aa770
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 0 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
Expand Down
9 changes: 8 additions & 1 deletion src/ResultStores/StoredCheckResults/StoredCheckResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ public static function fromJson(string $json): StoredCheckResults
$properties = json_decode($json, true);

$checkResults = collect($properties['checkResults'])
->map(fn (array $lineProperties) => new StoredCheckResult(...$lineProperties))
->map(fn (array $lineProperties) => new StoredCheckResult(
$lineProperties['name'],
$lineProperties['label'] ?? '',
$lineProperties['notificationMessage'] ?? '',
$lineProperties['shortSummary'] ?? '',
$lineProperties['status'] ?? '',
$lineProperties['meta'] ?? [],
))
->unique('name')
->sortBy(fn (StoredCheckResult $result) => strtolower($result->label));

Expand Down

0 comments on commit d4aa770

Please sign in to comment.