Skip to content

Commit b11ec27

Browse files
author
Grace Yim
committed
Remove unnecessary if statement in ApiRawRequester.request
1 parent 6301c3c commit b11ec27

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/ToopherApi.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,11 @@ private function request($method, $endpoint, $parameters = array(), $rawRequest
179179
}
180180

181181
$err = json_decode($resultBody, true);
182-
if ($err == NULL) {
182+
if ($err === NULL) {
183183
$jsonError = $this->json_error_to_string(json_last_error());
184-
if (!empty($jsonError))
185-
{
186-
error_log(sprintf('Error parsing response body JSON: %s', $jsonError));
187-
error_log(sprintf('Response body: %s', $result->getBody()));
188-
throw new ToopherRequestException(sprintf('JSON Parsing Error: %s', $jsonError));
189-
}
184+
error_log(sprintf('Error parsing response body JSON: %s', $jsonError));
185+
error_log(sprintf('Response body: %s', $result->getBody()));
186+
throw new ToopherRequestException(sprintf('JSON Parsing Error: %s', $jsonError));
190187
}
191188

192189
if(array_key_exists('error_message', $err))

0 commit comments

Comments
 (0)