diff --git a/src/Module/Api/Friendica/Activity.php b/src/Module/Api/Friendica/Activity.php index 70aeee613..3915c2089 100644 --- a/src/Module/Api/Friendica/Activity.php +++ b/src/Module/Api/Friendica/Activity.php @@ -52,7 +52,7 @@ class Activity extends BaseApi $res = Item::performActivity($request['id'], $this->parameters['verb'], $uid); if ($res) { - if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) { + if ($this->parameters['extension'] ?? '' == 'xml') { $ok = 'true'; } else { $ok = 'ok'; diff --git a/src/Module/Api/Friendica/Notification.php b/src/Module/Api/Friendica/Notification.php index 1f5ac9b48..d16e0e2b0 100644 --- a/src/Module/Api/Friendica/Notification.php +++ b/src/Module/Api/Friendica/Notification.php @@ -43,7 +43,7 @@ class Notification extends BaseApi $notifications[] = new ApiNotification($Notify); } - if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) { + if ($this->parameters['extension'] ?? '' == 'xml') { $xmlnotes = []; foreach ($notifications as $notification) { $xmlnotes[] = ['@attributes' => $notification->toArray()]; diff --git a/src/Module/Api/Friendica/Profile/Show.php b/src/Module/Api/Friendica/Profile/Show.php index 60f4f024b..2507b7e27 100644 --- a/src/Module/Api/Friendica/Profile/Show.php +++ b/src/Module/Api/Friendica/Profile/Show.php @@ -48,7 +48,7 @@ class Show extends BaseApi $profile = self::formatProfile($profile, $profileFields); $profiles = []; - if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) { + if ($this->parameters['extension'] ?? '' == 'xml') { $profiles['0:profile'] = $profile; } else { $profiles[] = $profile; diff --git a/src/Module/Api/GNUSocial/Help/Test.php b/src/Module/Api/GNUSocial/Help/Test.php index 4cfeda6ab..44a31ba88 100644 --- a/src/Module/Api/GNUSocial/Help/Test.php +++ b/src/Module/Api/GNUSocial/Help/Test.php @@ -31,7 +31,7 @@ class Test extends BaseApi { protected function rawContent(array $request = []) { - if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) { + if ($this->parameters['extension'] ?? '' == 'xml') { $ok = 'true'; } else { $ok = 'ok'; diff --git a/src/Module/Api/Twitter/Account/RateLimitStatus.php b/src/Module/Api/Twitter/Account/RateLimitStatus.php index 7a48f4f0e..60cee6ce3 100644 --- a/src/Module/Api/Twitter/Account/RateLimitStatus.php +++ b/src/Module/Api/Twitter/Account/RateLimitStatus.php @@ -31,7 +31,7 @@ class RateLimitStatus extends BaseApi { protected function rawContent(array $request = []) { - if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) { + if ($this->parameters['extension'] ?? '' == 'xml') { $hash = [ 'remaining-hits' => '150', '@attributes' => ["type" => "integer"],