Fix: Minor clean up

This commit is contained in:
Sarah Tsumayoi 2019-06-10 21:48:02 -04:00 committed by GitHub
parent fe7c9095fa
commit 960d0bc622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,14 @@
<?php
namespace humhub\libs;
use Yii;
use yii\helpers\Json;
class UrlOembedHttpClient implements UrlOembedClient
{
const RESPONSE_UNAUTHORIZED = 'Unauthorized';
const RESPONSE_NOT_FOUND = 'Not Found';
const ERROR_RESPONSES = [
@ -59,7 +58,7 @@ class UrlOembedHttpClient implements UrlOembedClient
protected function parseJson($json)
{
try {
if(!empty($json) && !in_array($json, static::ERROR_RESPONSES, true)) {
if (!empty($json) && !in_array($json, static::ERROR_RESPONSES, true)) {
return Json::decode($json);
}
} catch (\Exception $ex) {
@ -68,4 +67,4 @@ class UrlOembedHttpClient implements UrlOembedClient
return null;
}
}
}