Simplifying extension access
This commit is contained in:
parent
8e8ec9d2d2
commit
0e15715088
5 changed files with 5 additions and 5 deletions
|
@ -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';
|
||||
|
|
|
@ -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()];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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"],
|
||||
|
|
Loading…
Reference in a new issue