Switch static::$parameters to $this->parameters

This commit is contained in:
Philipp 2021-11-14 23:19:25 +01:00
parent 489cd0884a
commit 5879535822
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
116 changed files with 321 additions and 314 deletions

View file

@ -36,15 +36,15 @@ class Lists extends BaseApi
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty(static::$parameters['id'])) {
if (empty($this->parameters['id'])) {
DI::mstdnError()->UnprocessableEntity();
}
if (!Group::exists(static::$parameters['id'], $uid)) {
if (!Group::exists($this->parameters['id'], $uid)) {
DI::mstdnError()->RecordNotFound();
}
if (!Group::remove(static::$parameters['id'])) {
if (!Group::remove($this->parameters['id'])) {
DI::mstdnError()->InternalError();
}
@ -81,11 +81,11 @@ class Lists extends BaseApi
'replies_policy' => '', // One of: "followed", "list", or "none".
]);
if (empty($request['title']) || empty(static::$parameters['id'])) {
if (empty($request['title']) || empty($this->parameters['id'])) {
DI::mstdnError()->UnprocessableEntity();
}
Group::update(static::$parameters['id'], $request['title']);
Group::update($this->parameters['id'], $request['title']);
}
/**
@ -96,7 +96,7 @@ class Lists extends BaseApi
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
if (empty(static::$parameters['id'])) {
if (empty($this->parameters['id'])) {
$lists = [];
$groups = Group::getByUserId($uid);
@ -105,7 +105,7 @@ class Lists extends BaseApi
$lists[] = DI::mstdnList()->createFromGroupId($group['id']);
}
} else {
$id = static::$parameters['id'];
$id = $this->parameters['id'];
if (!Group::exists($id, $uid)) {
DI::mstdnError()->RecordNotFound();