Rename ApipResponse->exit* methods to better show their meaning

This commit is contained in:
Hypolite Petovan 2023-09-22 10:14:46 -04:00
parent 960171c4e0
commit 642baa1f2a
68 changed files with 88 additions and 88 deletions

View file

@ -105,6 +105,6 @@ class UpdateCredentials extends BaseApi
}
$account = DI::mstdnAccount()->createFromContactId($cdata['user'], $uid);
$this->response->exitWithJson($account->toArray());
$this->response->addJsonContent($account->toArray());
}
}

View file

@ -52,6 +52,6 @@ class VerifyCredentials extends BaseApi
// @todo Support the source property,
$account = DI::mstdnAccount()->createFromContactId($cdata['user'], $uid);
$this->response->exitWithJson($account->toArray());
$this->response->addJsonContent($account->toArray());
}
}

View file

@ -81,7 +81,7 @@ class PushSubscription extends BaseApi
$this->logger->info('Subscription stored', ['ret' => $ret, 'subscription' => $subscription]);
$subscriptionObj = $this->subscriptionFac->createForApplicationIdAndUserId($application['id'], $uid);
$this->response->exitWithJson($subscriptionObj->toArray());
$this->response->addJsonContent($subscriptionObj->toArray());
}
public function put(array $request = []): void
@ -120,7 +120,7 @@ class PushSubscription extends BaseApi
]);
$subscriptionObj = $this->subscriptionFac->createForApplicationIdAndUserId($application['id'], $uid);
$this->response->exitWithJson($subscriptionObj->toArray());
$this->response->addJsonContent($subscriptionObj->toArray());
}
protected function delete(array $request = []): void
@ -137,7 +137,7 @@ class PushSubscription extends BaseApi
'uid' => $uid,
]);
$this->response->exitWithJson([]);
$this->response->addJsonContent([]);
}
protected function rawContent(array $request = []): void
@ -154,6 +154,6 @@ class PushSubscription extends BaseApi
$this->logger->info('Fetch subscription', ['application-id' => $application['id'], 'uid' => $uid]);
$subscriptionObj = $this->subscriptionFac->createForApplicationIdAndUserId($application['id'], $uid);
$this->response->exitWithJson($subscriptionObj->toArray());
$this->response->addJsonContent($subscriptionObj->toArray());
}
}