Make BaseModule methods dynamic

This commit is contained in:
Philipp 2021-11-14 23:13:47 +01:00
parent 714f0febc4
commit 489cd0884a
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
253 changed files with 397 additions and 385 deletions

View file

@ -38,14 +38,14 @@ use Friendica\Util\Strings;
*/
class Advanced extends BaseModule
{
public static function init()
public function init()
{
if (!Session::isAuthenticated()) {
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
}
}
public static function post()
public function post()
{
$cid = static::$parameters['id'];
@ -96,7 +96,7 @@ class Advanced extends BaseModule
return;
}
public static function content()
public function content(): string
{
$cid = static::$parameters['id'];

View file

@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
class Contacts extends BaseModule
{
public static function content()
public function content(): string
{
$app = DI::app();

View file

@ -35,7 +35,7 @@ use Friendica\Util\Strings;
*/
class Hovercard extends BaseModule
{
public static function rawContent()
public function rawContent()
{
$contact_url = $_REQUEST['url'] ?? '';

View file

@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\BadRequestException;
*/
class Media extends BaseModule
{
public static function content()
public function content(): string
{
$cid = static::$parameters['id'];

View file

@ -18,7 +18,7 @@ use Friendica\Util\XML;
class Poke extends BaseModule
{
public static function post()
public function post()
{
if (!local_user() || empty(static::$parameters['id'])) {
return self::postReturn(false);
@ -123,7 +123,7 @@ class Poke extends BaseModule
return $success;
}
public static function content()
public function content(): string
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));

View file

@ -37,7 +37,7 @@ class Revoke extends BaseModule
/** @var array */
private static $contact;
public static function init()
public function init()
{
if (!local_user()) {
return;
@ -63,7 +63,7 @@ class Revoke extends BaseModule
}
}
public static function post()
public function post()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException();
@ -83,7 +83,7 @@ class Revoke extends BaseModule
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
}
public static function content(): string
public function content(): string
{
if (!local_user()) {
return Login::form($_SERVER['REQUEST_URI']);