Replace $parameters argument per method with static::$parameters

This commit is contained in:
Philipp 2021-11-14 20:46:25 +01:00
parent 018275919c
commit 714f0febc4
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
249 changed files with 710 additions and 775 deletions

View file

@ -42,9 +42,9 @@ class RemoteFollow extends BaseModule
{
static $owner;
public static function init(array $parameters = [])
public static function init()
{
self::$owner = User::getOwnerDataByNick($parameters['profile']);
self::$owner = User::getOwnerDataByNick(static::$parameters['profile']);
if (!self::$owner) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
@ -52,7 +52,7 @@ class RemoteFollow extends BaseModule
DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
}
public static function post(array $parameters = [])
public static function post()
{
if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
DI::baseUrl()->redirect();
@ -96,7 +96,7 @@ class RemoteFollow extends BaseModule
System::externalRedirect($follow_link);
}
public static function content(array $parameters = [])
public static function content()
{
if (empty(self::$owner)) {
return '';
@ -115,7 +115,7 @@ class RemoteFollow extends BaseModule
'$submit' => DI::l10n()->t('Submit Request'),
'$cancel' => DI::l10n()->t('Cancel'),
'$request' => 'remote_follow/' . $parameters['profile'],
'$request' => 'remote_follow/' . static::$parameters['profile'],
'$name' => self::$owner['name'],
'$myaddr' => Profile::getMyURL(),
]);