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

@ -47,7 +47,7 @@ class Advanced extends BaseModule
public function post()
{
$cid = static::$parameters['id'];
$cid = $this->parameters['id'];
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) {
@ -98,7 +98,7 @@ class Advanced extends BaseModule
public function content(): string
{
$cid = static::$parameters['id'];
$cid = $this->parameters['id'];
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) {

View file

@ -22,8 +22,8 @@ class Contacts extends BaseModule
throw new HTTPException\ForbiddenException();
}
$cid = static::$parameters['id'];
$type = static::$parameters['type'] ?? 'all';
$cid = $this->parameters['id'];
$type = $this->parameters['type'] ?? 'all';
$accounttype = $_GET['accounttype'] ?? '';
$accounttypeid = User::getAccountTypeByString($accounttype);

View file

@ -36,7 +36,7 @@ class Media extends BaseModule
{
public function content(): string
{
$cid = static::$parameters['id'];
$cid = $this->parameters['id'];
$contact = Model\Contact::selectFirst([], ['id' => $cid]);
if (empty($contact)) {

View file

@ -20,7 +20,7 @@ class Poke extends BaseModule
{
public function post()
{
if (!local_user() || empty(static::$parameters['id'])) {
if (!local_user() || empty($this->parameters['id'])) {
return self::postReturn(false);
}
@ -39,14 +39,14 @@ class Poke extends BaseModule
$activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]);
$contact_id = intval(static::$parameters['id']);
$contact_id = intval($this->parameters['id']);
if (!$contact_id) {
return self::postReturn(false);
}
Logger::info('verb ' . $verb . ' contact ' . $contact_id);
$contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
$contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $this->parameters['id'], 'uid' => local_user()]);
if (!DBA::isResult($contact)) {
return self::postReturn(false);
}
@ -129,11 +129,11 @@ class Poke extends BaseModule
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
}
if (empty(static::$parameters['id'])) {
if (empty($this->parameters['id'])) {
throw new HTTPException\BadRequestException();
}
$contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
$contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => $this->parameters['id'], 'uid' => local_user()]);
if (!DBA::isResult($contact)) {
throw new HTTPException\NotFoundException();
}

View file

@ -43,7 +43,7 @@ class Revoke extends BaseModule
return;
}
$data = Model\Contact::getPublicAndUserContactID(static::$parameters['id'], local_user());
$data = Model\Contact::getPublicAndUserContactID($this->parameters['id'], local_user());
if (!DBA::isResult($data)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown contact.'));
}
@ -69,7 +69,7 @@ class Revoke extends BaseModule
throw new HTTPException\UnauthorizedException();
}
self::checkFormSecurityTokenRedirectOnError('contact/' . static::$parameters['id'], 'contact_revoke');
self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke');
$result = Model\Contact::revokeFollow(self::$contact);
if ($result === true) {
@ -80,7 +80,7 @@ class Revoke extends BaseModule
notice(DI::l10n()->t('Unable to revoke follow, please try again later or contact the administrator.'));
}
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
DI::baseUrl()->redirect('contact/' . $this->parameters['id']);
}
public function content(): string