Skip to content

Commit 61a7bd5

Browse files
committed
Tiny cleanup
1 parent 052b0d2 commit 61a7bd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SolderClient.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ public static function validateKey(Client $client, $key)
177177
$body = $response->getBody();
178178
$json = json_decode($body, true);
179179

180-
if ($json) {
181-
if (array_key_exists("valid", $json)) {
182-
return true;
183-
}
184-
} else {
180+
if (!$json) {
185181
throw new BadJSONException('Failed to decode JSON response when verifying API key');
186182
}
187183

184+
if (array_key_exists("valid", $json)) {
185+
return true;
186+
}
187+
188188
return false;
189189
}
190190

0 commit comments

Comments
 (0)