Skip to content

Commit 607f446

Browse files
committed
Reformat Model\Validator::query()
1 parent 5254e03 commit 607f446

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Model/Validator.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,15 @@ private function query($prefix): array
8282
return $this->serializer->unserialize($cacheEntry);
8383
}
8484

85-
$hashes = [];
86-
8785
$this->httpClient->get(self::PWNED_BASE_URL . '/range/' . $prefix);
88-
8986
if ($this->httpClient->getStatus() !== 200) {
90-
return $hashes;
87+
return [];
9188
}
9289

9390
$body = $this->httpClient->getBody();
9491
$results = explode("\n", $body);
9592

93+
$hashes = [];
9694
foreach ($results as $value) {
9795
list($hash, $count) = explode(':', $value);
9896
$hashes[$hash] = (int)$count;

0 commit comments

Comments
 (0)