diff --git a/mod/display.php b/mod/display.php index b53dd3543..dce2a10ce 100644 --- a/mod/display.php +++ b/mod/display.php @@ -40,7 +40,7 @@ use Friendica\Protocol\DFRN; function display_init(App $a) { if (ActivityPub::isRequest()) { - Objects::rawContent(['guid' => DI::args()->getArgv()[1] ?? null]); + (new Objects(['guid' => DI::args()->getArgv()[1] ?? null]))->rawContent(); } if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { diff --git a/mod/unfollow.php b/mod/unfollow.php index 92bded2fa..633721164 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -122,7 +122,7 @@ function unfollow_process(string $url) $owner = User::getOwnerDataById($uid); if (!$owner) { - \Friendica\Module\Security\Logout::init(); + (new \Friendica\Module\Security\Logout())->init(); // NOTREACHED } diff --git a/src/App/Module.php b/src/App/Module.php index 0f0cfa656..0ed4b53e5 100644 --- a/src/App/Module.php +++ b/src/App/Module.php @@ -297,32 +297,32 @@ class Module Core\Hook::callAll($this->module . '_mod_init', $placeholder); - $this->module_class::init(); + $this->module_class->init(); $profiler->set(microtime(true) - $timestamp, 'init'); if ($server['REQUEST_METHOD'] === Router::DELETE) { - $this->module_class::delete(); + $this->module_class->delete(); } if ($server['REQUEST_METHOD'] === Router::PATCH) { - $this->module_class::patch(); + $this->module_class->patch(); } if ($server['REQUEST_METHOD'] === Router::POST) { Core\Hook::callAll($this->module . '_mod_post', $post); - $this->module_class::post(); + $this->module_class->post(); } if ($server['REQUEST_METHOD'] === Router::PUT) { - $this->module_class::put(); + $this->module_class->put(); } Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder); - $this->module_class::afterpost(); + $this->module_class->afterpost(); // "rawContent" is especially meant for technical endpoints. // This endpoint doesn't need any theme initialization or other comparable stuff. - $this->module_class::rawContent(); + $this->module_class->rawContent(); } } diff --git a/src/App/Page.php b/src/App/Page.php index c29517b1c..d7e04ea7c 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -350,13 +350,13 @@ class Page implements ArrayAccess $moduleClass = $module->getClass(); $arr = ['content' => $content]; - Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr); + Hook::callAll( $moduleClass->getClassName() . '_mod_content', $arr); $content = $arr['content']; - $arr = ['content' => $moduleClass::content()]; - Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr); + $arr = ['content' => $moduleClass->content()]; + Hook::callAll($moduleClass->getClassName() . '_mod_aftercontent', $arr); $content .= $arr['content']; } catch (HTTPException $e) { - $content = ModuleHTTPException::content($e); + $content = (new ModuleHTTPException())->content($e); } // initialise content region diff --git a/src/BaseModule.php b/src/BaseModule.php index b9db1953e..76458c6c6 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -47,14 +47,14 @@ abstract class BaseModule implements ICanHandleRequests /** * {@inheritDoc} */ - public static function init() + public function init() { } /** * {@inheritDoc} */ - public static function rawContent() + public function rawContent() { // echo ''; // exit; @@ -63,7 +63,7 @@ abstract class BaseModule implements ICanHandleRequests /** * {@inheritDoc} */ - public static function content() + public function content(): string { return ''; } @@ -71,21 +71,21 @@ abstract class BaseModule implements ICanHandleRequests /** * {@inheritDoc} */ - public static function delete() + public function delete() { } /** * {@inheritDoc} */ - public static function patch() + public function patch() { } /** * {@inheritDoc} */ - public static function post() + public function post() { // DI::baseurl()->redirect('module'); } @@ -93,19 +93,19 @@ abstract class BaseModule implements ICanHandleRequests /** * {@inheritDoc} */ - public static function afterpost() + public function afterpost() { } /** * {@inheritDoc} */ - public static function put() + public function put() { } /** Gets the name of the current class */ - public static function getClassName(): string + public function getClassName(): string { return static::class; } diff --git a/src/Capabilities/ICanHandleRequests.php b/src/Capabilities/ICanHandleRequests.php index 1d4420877..277340464 100644 --- a/src/Capabilities/ICanHandleRequests.php +++ b/src/Capabilities/ICanHandleRequests.php @@ -13,7 +13,7 @@ interface ICanHandleRequests * Extend this method if you need to do any shared processing before both * content() or post() */ - public static function init(); + public function init(); /** * Module GET method to display raw content from technical endpoints @@ -21,7 +21,7 @@ interface ICanHandleRequests * Extend this method if the module is supposed to return communication data, * e.g. from protocol implementations. */ - public static function rawContent(); + public function rawContent(); /** * Module GET method to display any content @@ -29,10 +29,8 @@ interface ICanHandleRequests * Extend this method if the module is supposed to return any display * through a GET request. It can be an HTML page through templating or a * XML feed or a JSON output. - * - * @return string */ - public static function content(); + public function content(): string; /** * Module DELETE method to process submitted data @@ -40,7 +38,7 @@ interface ICanHandleRequests * Extend this method if the module is supposed to process DELETE requests. * Doesn't display any content */ - public static function delete(); + public function delete(); /** * Module PATCH method to process submitted data @@ -48,7 +46,7 @@ interface ICanHandleRequests * Extend this method if the module is supposed to process PATCH requests. * Doesn't display any content */ - public static function patch(); + public function patch(); /** * Module POST method to process submitted data @@ -56,14 +54,14 @@ interface ICanHandleRequests * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post(); + public function post(); /** * Called after post() * * Unknown purpose */ - public static function afterpost(); + public function afterpost(); /** * Module PUT method to process submitted data @@ -71,7 +69,7 @@ interface ICanHandleRequests * Extend this method if the module is supposed to process PUT requests. * Doesn't display any content */ - public static function put(); + public function put(); - public static function getClassName(): string; + public function getClassName(): string; } diff --git a/src/LegacyModule.php b/src/LegacyModule.php index ac4d5cd2c..e90b004bc 100644 --- a/src/LegacyModule.php +++ b/src/LegacyModule.php @@ -54,22 +54,22 @@ class LegacyModule extends BaseModule require_once $file_path; } - public static function init() + public function init() { self::runModuleFunction('init', static::$parameters); } - public static function content() + public function content(): string { return self::runModuleFunction('content', static::$parameters); } - public static function post() + public function post() { self::runModuleFunction('post', static::$parameters); } - public static function afterpost() + public function afterpost() { self::runModuleFunction('afterpost', static::$parameters); } diff --git a/src/Module/AccountManagementControlDocument.php b/src/Module/AccountManagementControlDocument.php index 8c87343d5..8de9e80af 100644 --- a/src/Module/AccountManagementControlDocument.php +++ b/src/Module/AccountManagementControlDocument.php @@ -30,7 +30,7 @@ use Friendica\BaseModule; */ class AccountManagementControlDocument extends BaseModule { - public static function rawContent() + public function rawContent() { $output = [ 'version' => 1, diff --git a/src/Module/Acctlink.php b/src/Module/Acctlink.php index f8184c82f..b14bbf8d7 100644 --- a/src/Module/Acctlink.php +++ b/src/Module/Acctlink.php @@ -30,7 +30,7 @@ use Friendica\Model\Contact; */ class Acctlink extends BaseModule { - public static function content() + public function content(): string { $addr = trim($_GET['addr'] ?? ''); @@ -41,5 +41,7 @@ class Acctlink extends BaseModule exit(); } } + + return ''; } } diff --git a/src/Module/ActivityPub/Followers.php b/src/Module/ActivityPub/Followers.php index 8c90b2ac0..e19e7eacf 100644 --- a/src/Module/ActivityPub/Followers.php +++ b/src/Module/ActivityPub/Followers.php @@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub; */ class Followers extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['nickname'])) { throw new \Friendica\Network\HTTPException\NotFoundException(); diff --git a/src/Module/ActivityPub/Following.php b/src/Module/ActivityPub/Following.php index 08574b546..2fa2d640f 100644 --- a/src/Module/ActivityPub/Following.php +++ b/src/Module/ActivityPub/Following.php @@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub; */ class Following extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['nickname'])) { throw new \Friendica\Network\HTTPException\NotFoundException(); diff --git a/src/Module/ActivityPub/Inbox.php b/src/Module/ActivityPub/Inbox.php index 3e0ca1856..4056a7de3 100644 --- a/src/Module/ActivityPub/Inbox.php +++ b/src/Module/ActivityPub/Inbox.php @@ -35,7 +35,7 @@ use Friendica\Util\Network; */ class Inbox extends BaseModule { - public static function rawContent() + public function rawContent() { $postdata = Network::postdata(); diff --git a/src/Module/ActivityPub/Objects.php b/src/Module/ActivityPub/Objects.php index 826bfd10c..eedcb0bd4 100644 --- a/src/Module/ActivityPub/Objects.php +++ b/src/Module/ActivityPub/Objects.php @@ -41,7 +41,7 @@ use Friendica\Util\Strings; */ class Objects extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['guid'])) { throw new HTTPException\BadRequestException(); diff --git a/src/Module/ActivityPub/Outbox.php b/src/Module/ActivityPub/Outbox.php index a2ae10839..55144ce1b 100644 --- a/src/Module/ActivityPub/Outbox.php +++ b/src/Module/ActivityPub/Outbox.php @@ -31,7 +31,7 @@ use Friendica\Util\HTTPSignature; */ class Outbox extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['nickname'])) { throw new \Friendica\Network\HTTPException\NotFoundException(); diff --git a/src/Module/Admin/Addons/Details.php b/src/Module/Admin/Addons/Details.php index dbb2a67a0..7748926cc 100644 --- a/src/Module/Admin/Addons/Details.php +++ b/src/Module/Admin/Addons/Details.php @@ -30,7 +30,7 @@ use Friendica\Util\Strings; class Details extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -52,7 +52,7 @@ class Details extends BaseAdmin DI::baseUrl()->redirect($redirect); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index e018b7c70..6330ee2cf 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin; class Index extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index 33041ee9b..a0a5c282f 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -32,7 +32,7 @@ use Friendica\Util\Network; class Contact extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -76,7 +76,7 @@ class Contact extends BaseAdmin DI::baseUrl()->redirect('admin/blocklist/contact'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Blocklist/Server/Add.php b/src/Module/Admin/Blocklist/Server/Add.php index 56b7400f1..47c9016d9 100644 --- a/src/Module/Admin/Blocklist/Server/Add.php +++ b/src/Module/Admin/Blocklist/Server/Add.php @@ -32,7 +32,7 @@ use GuzzleHttp\Psr7\Uri; class Add extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -66,7 +66,7 @@ class Add extends BaseAdmin DI::baseUrl()->redirect('admin/blocklist/server'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Blocklist/Server/Index.php b/src/Module/Admin/Blocklist/Server/Index.php index e819c9366..ebd39d36a 100644 --- a/src/Module/Admin/Blocklist/Server/Index.php +++ b/src/Module/Admin/Blocklist/Server/Index.php @@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin; class Index extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -56,7 +56,7 @@ class Index extends BaseAdmin DI::baseUrl()->redirect('admin/blocklist/server'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/DBSync.php b/src/Module/Admin/DBSync.php index ef9df4491..90588cfa9 100644 --- a/src/Module/Admin/DBSync.php +++ b/src/Module/Admin/DBSync.php @@ -30,7 +30,7 @@ use Friendica\Module\BaseAdmin; class DBSync extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Features.php b/src/Module/Admin/Features.php index 76bb35f53..d2c8e2d83 100644 --- a/src/Module/Admin/Features.php +++ b/src/Module/Admin/Features.php @@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin; class Features extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -60,7 +60,7 @@ class Features extends BaseAdmin DI::baseUrl()->redirect('admin/features'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 9d0070e2d..65d0453d9 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin; class Federation extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index 9380b02e0..91bb71932 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -29,7 +29,7 @@ use Friendica\Util\Strings; class Delete extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -55,7 +55,7 @@ class Delete extends BaseAdmin DI::baseUrl()->redirect('admin/item/delete'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Item/Source.php b/src/Module/Admin/Item/Source.php index a6dac1a1a..9b81d9e76 100644 --- a/src/Module/Admin/Item/Source.php +++ b/src/Module/Admin/Item/Source.php @@ -29,7 +29,7 @@ use Friendica\Module\BaseAdmin; class Source extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index faf742663..aaf603f82 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -29,7 +29,7 @@ use Psr\Log\LogLevel; class Settings extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -56,7 +56,7 @@ class Settings extends BaseAdmin DI::baseUrl()->redirect('admin/logs'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Logs/View.php b/src/Module/Admin/Logs/View.php index d1d44c00f..3e312204b 100644 --- a/src/Module/Admin/Logs/View.php +++ b/src/Module/Admin/Logs/View.php @@ -31,7 +31,7 @@ class View extends BaseAdmin { const LIMIT = 500; - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/PhpInfo.php b/src/Module/Admin/PhpInfo.php index 8bf15cb0e..e6cad66c7 100644 --- a/src/Module/Admin/PhpInfo.php +++ b/src/Module/Admin/PhpInfo.php @@ -25,7 +25,7 @@ use Friendica\Module\BaseAdmin; class PhpInfo extends BaseAdmin { - public static function rawContent() + public function rawContent() { self::checkAdminAccess(); diff --git a/src/Module/Admin/Queue.php b/src/Module/Admin/Queue.php index 69c16c39d..b3460c9aa 100644 --- a/src/Module/Admin/Queue.php +++ b/src/Module/Admin/Queue.php @@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat; */ class Queue extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index e8d463f80..27623880a 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -43,7 +43,7 @@ require_once __DIR__ . '/../../../boot.php'; class Site extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -384,7 +384,7 @@ class Site extends BaseAdmin DI::baseUrl()->redirect('admin/site' . $active_panel); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Storage.php b/src/Module/Admin/Storage.php index 1f598c1a2..d0d9c3aa4 100644 --- a/src/Module/Admin/Storage.php +++ b/src/Module/Admin/Storage.php @@ -31,7 +31,7 @@ use Friendica\Util\Strings; class Storage extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -91,7 +91,7 @@ class Storage extends BaseAdmin DI::baseUrl()->redirect('admin/storage'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 1eeba4883..5b2efca1e 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -37,7 +37,7 @@ use Friendica\Util\DateTimeFormat; class Summary extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index bd0257268..b81b76ab3 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -30,7 +30,7 @@ use Friendica\Util\Strings; class Details extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 59855b13b..277933802 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -28,7 +28,7 @@ use Friendica\Util\Strings; class Embed extends BaseAdmin { - public static function init() + public function init() { $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']); if (is_file("view/theme/$theme/config.php")) { @@ -36,7 +36,7 @@ class Embed extends BaseAdmin } } - public static function post() + public function post() { self::checkAdminAccess(); @@ -56,7 +56,7 @@ class Embed extends BaseAdmin DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index 7bd09695e..ad4dfef94 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -29,7 +29,7 @@ use Friendica\Util\Strings; class Index extends BaseAdmin { - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Tos.php b/src/Module/Admin/Tos.php index a31b403f9..3c0b00deb 100644 --- a/src/Module/Admin/Tos.php +++ b/src/Module/Admin/Tos.php @@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin; class Tos extends BaseAdmin { - public static function post() + public function post() { self::checkAdminAccess(); @@ -48,7 +48,7 @@ class Tos extends BaseAdmin DI::baseUrl()->redirect('admin/tos'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Active.php b/src/Module/Admin/Users/Active.php index 4882ac4eb..613c89764 100644 --- a/src/Module/Admin/Users/Active.php +++ b/src/Module/Admin/Users/Active.php @@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers; class Active extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -60,7 +60,7 @@ class Active extends BaseUsers DI::baseUrl()->redirect(DI::args()->getQueryString()); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Blocked.php b/src/Module/Admin/Users/Blocked.php index 6b8008165..9ef6dab87 100644 --- a/src/Module/Admin/Users/Blocked.php +++ b/src/Module/Admin/Users/Blocked.php @@ -31,7 +31,7 @@ use Friendica\Util\Temporal; class Blocked extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -61,7 +61,7 @@ class Blocked extends BaseUsers DI::baseUrl()->redirect('admin/users/blocked'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Create.php b/src/Module/Admin/Users/Create.php index b80866603..71ab5b4cb 100644 --- a/src/Module/Admin/Users/Create.php +++ b/src/Module/Admin/Users/Create.php @@ -28,7 +28,7 @@ use Friendica\Module\Admin\BaseUsers; class Create extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -51,7 +51,7 @@ class Create extends BaseUsers DI::baseUrl()->redirect('admin/users/create'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Deleted.php b/src/Module/Admin/Users/Deleted.php index 8d71b4792..6357b2396 100644 --- a/src/Module/Admin/Users/Deleted.php +++ b/src/Module/Admin/Users/Deleted.php @@ -33,7 +33,7 @@ use Friendica\Util\Temporal; class Deleted extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -44,7 +44,7 @@ class Deleted extends BaseUsers DI::baseUrl()->redirect('admin/users/deleted'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Index.php b/src/Module/Admin/Users/Index.php index 1137b2cf9..dff00083b 100644 --- a/src/Module/Admin/Users/Index.php +++ b/src/Module/Admin/Users/Index.php @@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers; class Index extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -67,7 +67,7 @@ class Index extends BaseUsers DI::baseUrl()->redirect(DI::args()->getQueryString()); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Admin/Users/Pending.php b/src/Module/Admin/Users/Pending.php index ef7d7b12e..eb90db7b9 100644 --- a/src/Module/Admin/Users/Pending.php +++ b/src/Module/Admin/Users/Pending.php @@ -33,7 +33,7 @@ use Friendica\Util\Temporal; class Pending extends BaseUsers { - public static function post() + public function post() { self::checkAdminAccess(); @@ -58,7 +58,7 @@ class Pending extends BaseUsers DI::baseUrl()->redirect('admin/users/pending'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Api/Friendica/Activity.php b/src/Module/Api/Friendica/Activity.php index b80d0585b..5f28297b4 100644 --- a/src/Module/Api/Friendica/Activity.php +++ b/src/Module/Api/Friendica/Activity.php @@ -40,7 +40,7 @@ use Friendica\Module\BaseApi; */ class Activity extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/DirectMessages/Setseen.php b/src/Module/Api/Friendica/DirectMessages/Setseen.php index dfffe3bbf..944376aad 100644 --- a/src/Module/Api/Friendica/DirectMessages/Setseen.php +++ b/src/Module/Api/Friendica/DirectMessages/Setseen.php @@ -30,7 +30,7 @@ use Friendica\Module\BaseApi; */ class Setseen extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Events/Index.php b/src/Module/Api/Friendica/Events/Index.php index 8a610c9d1..439e021f3 100644 --- a/src/Module/Api/Friendica/Events/Index.php +++ b/src/Module/Api/Friendica/Events/Index.php @@ -33,7 +33,7 @@ use Friendica\Module\BaseApi; */ class Index extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Index.php b/src/Module/Api/Friendica/Index.php index b028d8bb6..dbe45f545 100644 --- a/src/Module/Api/Friendica/Index.php +++ b/src/Module/Api/Friendica/Index.php @@ -31,17 +31,17 @@ use Friendica\Module\BaseApi; */ class Index extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); } - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_WRITE); } - public static function rawContent() + public function rawContent() { echo api_call(DI::app()); exit(); diff --git a/src/Module/Api/Friendica/Notification.php b/src/Module/Api/Friendica/Notification.php index 6dc4f7831..3057c8cb7 100644 --- a/src/Module/Api/Friendica/Notification.php +++ b/src/Module/Api/Friendica/Notification.php @@ -31,7 +31,7 @@ use Friendica\Object\Api\Friendica\Notification as ApiNotification; */ class Notification extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Photo/Delete.php b/src/Module/Api/Friendica/Photo/Delete.php index 4eb8e0dcc..d98296625 100644 --- a/src/Module/Api/Friendica/Photo/Delete.php +++ b/src/Module/Api/Friendica/Photo/Delete.php @@ -33,7 +33,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException; */ class Delete extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Photoalbum/Delete.php b/src/Module/Api/Friendica/Photoalbum/Delete.php index f6dc85fce..01d05f44b 100644 --- a/src/Module/Api/Friendica/Photoalbum/Delete.php +++ b/src/Module/Api/Friendica/Photoalbum/Delete.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException; */ class Delete extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Photoalbum/Update.php b/src/Module/Api/Friendica/Photoalbum/Update.php index 311396db3..b45f6ced4 100644 --- a/src/Module/Api/Friendica/Photoalbum/Update.php +++ b/src/Module/Api/Friendica/Photoalbum/Update.php @@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException; */ class Update extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Friendica/Profile/Show.php b/src/Module/Api/Friendica/Profile/Show.php index ae14c8d41..a1280eb7c 100644 --- a/src/Module/Api/Friendica/Profile/Show.php +++ b/src/Module/Api/Friendica/Profile/Show.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException; */ class Show extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/GNUSocial/GNUSocial/Version.php b/src/Module/Api/GNUSocial/GNUSocial/Version.php index 34fc3c692..d8ff5c95f 100644 --- a/src/Module/Api/GNUSocial/GNUSocial/Version.php +++ b/src/Module/Api/GNUSocial/GNUSocial/Version.php @@ -29,7 +29,7 @@ use Friendica\DI; */ class Version extends BaseApi { - public static function rawContent() + public function rawContent() { DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null); } diff --git a/src/Module/Api/GNUSocial/Help/Test.php b/src/Module/Api/GNUSocial/Help/Test.php index 6eedfc1ca..d15782286 100644 --- a/src/Module/Api/GNUSocial/Help/Test.php +++ b/src/Module/Api/GNUSocial/Help/Test.php @@ -29,7 +29,7 @@ use Friendica\DI; */ class Test extends BaseApi { - public static function rawContent() + public function rawContent() { if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) { $ok = 'true'; diff --git a/src/Module/Api/Mastodon/Accounts.php b/src/Module/Api/Mastodon/Accounts.php index 360993397..13981684f 100644 --- a/src/Module/Api/Mastodon/Accounts.php +++ b/src/Module/Api/Mastodon/Accounts.php @@ -35,7 +35,7 @@ class Accounts extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Block.php b/src/Module/Api/Mastodon/Accounts/Block.php index c32862ca4..522eeb11f 100644 --- a/src/Module/Api/Mastodon/Accounts/Block.php +++ b/src/Module/Api/Mastodon/Accounts/Block.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Block extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/FeaturedTags.php b/src/Module/Api/Mastodon/Accounts/FeaturedTags.php index cbb409d1b..fe92696a0 100644 --- a/src/Module/Api/Mastodon/Accounts/FeaturedTags.php +++ b/src/Module/Api/Mastodon/Accounts/FeaturedTags.php @@ -32,7 +32,7 @@ class FeaturedTags extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); diff --git a/src/Module/Api/Mastodon/Accounts/Follow.php b/src/Module/Api/Mastodon/Accounts/Follow.php index b02ee1802..3ed761172 100644 --- a/src/Module/Api/Mastodon/Accounts/Follow.php +++ b/src/Module/Api/Mastodon/Accounts/Follow.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Follow extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Followers.php b/src/Module/Api/Mastodon/Accounts/Followers.php index 3d24da2df..3270da828 100644 --- a/src/Module/Api/Mastodon/Accounts/Followers.php +++ b/src/Module/Api/Mastodon/Accounts/Followers.php @@ -34,7 +34,7 @@ class Followers extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Following.php b/src/Module/Api/Mastodon/Accounts/Following.php index d3d804704..9768d2a03 100644 --- a/src/Module/Api/Mastodon/Accounts/Following.php +++ b/src/Module/Api/Mastodon/Accounts/Following.php @@ -34,7 +34,7 @@ class Following extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/IdentityProofs.php b/src/Module/Api/Mastodon/Accounts/IdentityProofs.php index f36d656f5..88379440a 100644 --- a/src/Module/Api/Mastodon/Accounts/IdentityProofs.php +++ b/src/Module/Api/Mastodon/Accounts/IdentityProofs.php @@ -32,7 +32,7 @@ class IdentityProofs extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); diff --git a/src/Module/Api/Mastodon/Accounts/Lists.php b/src/Module/Api/Mastodon/Accounts/Lists.php index 3ec24bcc1..4860c4fe5 100644 --- a/src/Module/Api/Mastodon/Accounts/Lists.php +++ b/src/Module/Api/Mastodon/Accounts/Lists.php @@ -35,7 +35,7 @@ class Lists extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Mute.php b/src/Module/Api/Mastodon/Accounts/Mute.php index b0b14a614..159afdfd9 100644 --- a/src/Module/Api/Mastodon/Accounts/Mute.php +++ b/src/Module/Api/Mastodon/Accounts/Mute.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Mute extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Note.php b/src/Module/Api/Mastodon/Accounts/Note.php index ae6e582e8..d14afbb48 100644 --- a/src/Module/Api/Mastodon/Accounts/Note.php +++ b/src/Module/Api/Mastodon/Accounts/Note.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Note extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Relationships.php b/src/Module/Api/Mastodon/Accounts/Relationships.php index 28135e5eb..451b7b49e 100644 --- a/src/Module/Api/Mastodon/Accounts/Relationships.php +++ b/src/Module/Api/Mastodon/Accounts/Relationships.php @@ -34,7 +34,7 @@ class Relationships extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Search.php b/src/Module/Api/Mastodon/Accounts/Search.php index 6b9d2d43f..fb3aafaec 100644 --- a/src/Module/Api/Mastodon/Accounts/Search.php +++ b/src/Module/Api/Mastodon/Accounts/Search.php @@ -37,7 +37,7 @@ class Search extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Statuses.php b/src/Module/Api/Mastodon/Accounts/Statuses.php index c3252d59f..1c95d74c7 100644 --- a/src/Module/Api/Mastodon/Accounts/Statuses.php +++ b/src/Module/Api/Mastodon/Accounts/Statuses.php @@ -39,7 +39,7 @@ class Statuses extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Unblock.php b/src/Module/Api/Mastodon/Accounts/Unblock.php index 26a115042..aed46c332 100644 --- a/src/Module/Api/Mastodon/Accounts/Unblock.php +++ b/src/Module/Api/Mastodon/Accounts/Unblock.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Unblock extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Unfollow.php b/src/Module/Api/Mastodon/Accounts/Unfollow.php index cd7aef7ab..78b6bad62 100644 --- a/src/Module/Api/Mastodon/Accounts/Unfollow.php +++ b/src/Module/Api/Mastodon/Accounts/Unfollow.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Unfollow extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/Unmute.php b/src/Module/Api/Mastodon/Accounts/Unmute.php index eb1ad8bfa..3e9146f21 100644 --- a/src/Module/Api/Mastodon/Accounts/Unmute.php +++ b/src/Module/Api/Mastodon/Accounts/Unmute.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Unmute extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php b/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php index 264a2a4a8..2c55bff43 100644 --- a/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php +++ b/src/Module/Api/Mastodon/Accounts/UpdateCredentials.php @@ -32,7 +32,7 @@ use Friendica\Util\HTTPInputData; */ class UpdateCredentials extends BaseApi { - public static function patch() + public function patch() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php b/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php index f91545ee1..0cce46037 100644 --- a/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php +++ b/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php @@ -35,7 +35,7 @@ class VerifyCredentials extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Announcements.php b/src/Module/Api/Mastodon/Announcements.php index 23ad0feeb..b8d231df6 100644 --- a/src/Module/Api/Mastodon/Announcements.php +++ b/src/Module/Api/Mastodon/Announcements.php @@ -32,7 +32,7 @@ class Announcements extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); diff --git a/src/Module/Api/Mastodon/Apps.php b/src/Module/Api/Mastodon/Apps.php index adbcd723d..a00bd4085 100644 --- a/src/Module/Api/Mastodon/Apps.php +++ b/src/Module/Api/Mastodon/Apps.php @@ -35,7 +35,7 @@ class Apps extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function post() + public function post() { $request = self::getRequest([ 'client_name' => '', diff --git a/src/Module/Api/Mastodon/Apps/VerifyCredentials.php b/src/Module/Api/Mastodon/Apps/VerifyCredentials.php index baa3aa7fa..e9720da0f 100644 --- a/src/Module/Api/Mastodon/Apps/VerifyCredentials.php +++ b/src/Module/Api/Mastodon/Apps/VerifyCredentials.php @@ -30,7 +30,7 @@ use Friendica\Module\BaseApi; */ class VerifyCredentials extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $application = self::getCurrentApplication(); diff --git a/src/Module/Api/Mastodon/Blocks.php b/src/Module/Api/Mastodon/Blocks.php index fbcaf2ded..c141b0482 100644 --- a/src/Module/Api/Mastodon/Blocks.php +++ b/src/Module/Api/Mastodon/Blocks.php @@ -34,7 +34,7 @@ class Blocks extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Bookmarks.php b/src/Module/Api/Mastodon/Bookmarks.php index 6cfa08772..7b51e4316 100644 --- a/src/Module/Api/Mastodon/Bookmarks.php +++ b/src/Module/Api/Mastodon/Bookmarks.php @@ -36,7 +36,7 @@ class Bookmarks extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Conversations.php b/src/Module/Api/Mastodon/Conversations.php index af2632ae6..fbee5672e 100644 --- a/src/Module/Api/Mastodon/Conversations.php +++ b/src/Module/Api/Mastodon/Conversations.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Conversations extends BaseApi { - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -49,7 +49,7 @@ class Conversations extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Conversations/Read.php b/src/Module/Api/Mastodon/Conversations/Read.php index b23a95b5e..27f012c01 100644 --- a/src/Module/Api/Mastodon/Conversations/Read.php +++ b/src/Module/Api/Mastodon/Conversations/Read.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Read extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/CustomEmojis.php b/src/Module/Api/Mastodon/CustomEmojis.php index a16eedf2f..1fedf5348 100644 --- a/src/Module/Api/Mastodon/CustomEmojis.php +++ b/src/Module/Api/Mastodon/CustomEmojis.php @@ -37,7 +37,7 @@ class CustomEmojis extends BaseApi * @throws \ImagickException * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows */ - public static function rawContent() + public function rawContent() { $emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList()); diff --git a/src/Module/Api/Mastodon/Directory.php b/src/Module/Api/Mastodon/Directory.php index ec579d2da..e48a70959 100644 --- a/src/Module/Api/Mastodon/Directory.php +++ b/src/Module/Api/Mastodon/Directory.php @@ -39,7 +39,7 @@ class Directory extends BaseApi * @throws \ImagickException * @see https://docs.joinmastodon.org/methods/instance/directory/ */ - public static function rawContent() + public function rawContent() { $request = self::getRequest([ 'offset' => 0, // How many accounts to skip before returning results. Default 0. diff --git a/src/Module/Api/Mastodon/Endorsements.php b/src/Module/Api/Mastodon/Endorsements.php index 5b90cc48a..b9a5bc2cd 100644 --- a/src/Module/Api/Mastodon/Endorsements.php +++ b/src/Module/Api/Mastodon/Endorsements.php @@ -32,7 +32,7 @@ class Endorsements extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { System::jsonExit([]); } diff --git a/src/Module/Api/Mastodon/Favourited.php b/src/Module/Api/Mastodon/Favourited.php index f49d35a7b..48aa452f2 100644 --- a/src/Module/Api/Mastodon/Favourited.php +++ b/src/Module/Api/Mastodon/Favourited.php @@ -37,7 +37,7 @@ class Favourited extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Filters.php b/src/Module/Api/Mastodon/Filters.php index 365ed65f3..5bf50db1a 100644 --- a/src/Module/Api/Mastodon/Filters.php +++ b/src/Module/Api/Mastodon/Filters.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Filters extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); @@ -41,7 +41,7 @@ class Filters extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); diff --git a/src/Module/Api/Mastodon/FollowRequests.php b/src/Module/Api/Mastodon/FollowRequests.php index 2fb548b35..a334b897a 100644 --- a/src/Module/Api/Mastodon/FollowRequests.php +++ b/src/Module/Api/Mastodon/FollowRequests.php @@ -42,7 +42,7 @@ class FollowRequests extends BaseApi * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow */ - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); @@ -82,7 +82,7 @@ class FollowRequests extends BaseApi * @throws \ImagickException * @see https://docs.joinmastodon.org/methods/accounts/follow_requests/ */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Instance.php b/src/Module/Api/Mastodon/Instance.php index 5f3345853..b7dc7d700 100644 --- a/src/Module/Api/Mastodon/Instance.php +++ b/src/Module/Api/Mastodon/Instance.php @@ -33,7 +33,7 @@ class Instance extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { System::jsonExit(InstanceEntity::get()); } diff --git a/src/Module/Api/Mastodon/Instance/Peers.php b/src/Module/Api/Mastodon/Instance/Peers.php index 5d4642e0b..b1fdd062b 100644 --- a/src/Module/Api/Mastodon/Instance/Peers.php +++ b/src/Module/Api/Mastodon/Instance/Peers.php @@ -36,7 +36,7 @@ class Peers extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $return = []; diff --git a/src/Module/Api/Mastodon/Instance/Rules.php b/src/Module/Api/Mastodon/Instance/Rules.php index bb5822702..3063bf9ea 100644 --- a/src/Module/Api/Mastodon/Instance/Rules.php +++ b/src/Module/Api/Mastodon/Instance/Rules.php @@ -36,7 +36,7 @@ class Rules extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $rules = []; $id = 0; diff --git a/src/Module/Api/Mastodon/Lists.php b/src/Module/Api/Mastodon/Lists.php index f977ce103..8a3f7a0ad 100644 --- a/src/Module/Api/Mastodon/Lists.php +++ b/src/Module/Api/Mastodon/Lists.php @@ -31,7 +31,7 @@ use Friendica\Model\Group; */ class Lists extends BaseApi { - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -51,7 +51,7 @@ class Lists extends BaseApi System::jsonExit([]); } - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -74,7 +74,7 @@ class Lists extends BaseApi System::jsonExit(DI::mstdnList()->createFromGroupId($id)); } - public static function put() + public function put() { $request = self::getRequest([ 'title' => '', // The title of the list to be updated. @@ -91,7 +91,7 @@ class Lists extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index 0e008602d..cdc75b6d4 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -35,12 +35,12 @@ use Friendica\Module\BaseApi; */ class Accounts extends BaseApi { - public static function delete() + public function delete() { DI::apiResponse()->unsupported(Router::DELETE); } - public static function post() + public function post() { DI::apiResponse()->unsupported(Router::POST); } @@ -48,7 +48,7 @@ class Accounts extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Markers.php b/src/Module/Api/Mastodon/Markers.php index 5843585e2..6a01a30cf 100644 --- a/src/Module/Api/Mastodon/Markers.php +++ b/src/Module/Api/Mastodon/Markers.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class Markers extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); @@ -41,7 +41,7 @@ class Markers extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); diff --git a/src/Module/Api/Mastodon/Media.php b/src/Module/Api/Mastodon/Media.php index 65aa28139..cd858f5ee 100644 --- a/src/Module/Api/Mastodon/Media.php +++ b/src/Module/Api/Mastodon/Media.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Media extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -53,7 +53,7 @@ class Media extends BaseApi System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id'])); } - public static function put() + public function put() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -82,7 +82,7 @@ class Media extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Mutes.php b/src/Module/Api/Mastodon/Mutes.php index da9b75dd9..b5ba3fcfd 100644 --- a/src/Module/Api/Mastodon/Mutes.php +++ b/src/Module/Api/Mastodon/Mutes.php @@ -34,7 +34,7 @@ class Mutes extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Notifications.php b/src/Module/Api/Mastodon/Notifications.php index 3c2e0d438..c2ddf2a4d 100644 --- a/src/Module/Api/Mastodon/Notifications.php +++ b/src/Module/Api/Mastodon/Notifications.php @@ -40,7 +40,7 @@ class Notifications extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Notifications/Clear.php b/src/Module/Api/Mastodon/Notifications/Clear.php index 93639d8a6..424979157 100644 --- a/src/Module/Api/Mastodon/Notifications/Clear.php +++ b/src/Module/Api/Mastodon/Notifications/Clear.php @@ -30,7 +30,7 @@ use Friendica\Module\BaseApi; */ class Clear extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Notifications/Dismiss.php b/src/Module/Api/Mastodon/Notifications/Dismiss.php index e3fc3290a..b135b5bbf 100644 --- a/src/Module/Api/Mastodon/Notifications/Dismiss.php +++ b/src/Module/Api/Mastodon/Notifications/Dismiss.php @@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\ForbiddenException; */ class Dismiss extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Preferences.php b/src/Module/Api/Mastodon/Preferences.php index 21361e1f3..6d846c35b 100644 --- a/src/Module/Api/Mastodon/Preferences.php +++ b/src/Module/Api/Mastodon/Preferences.php @@ -34,7 +34,7 @@ class Preferences extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Proofs.php b/src/Module/Api/Mastodon/Proofs.php index 9bdc77f49..c9b92246a 100644 --- a/src/Module/Api/Mastodon/Proofs.php +++ b/src/Module/Api/Mastodon/Proofs.php @@ -32,7 +32,7 @@ class Proofs extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { System::jsonError(404, ['error' => 'Record not found']); } diff --git a/src/Module/Api/Mastodon/PushSubscription.php b/src/Module/Api/Mastodon/PushSubscription.php index 715041643..e45c943f5 100644 --- a/src/Module/Api/Mastodon/PushSubscription.php +++ b/src/Module/Api/Mastodon/PushSubscription.php @@ -33,7 +33,7 @@ use Friendica\Object\Api\Mastodon\Notification; */ class PushSubscription extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_PUSH); $uid = self::getCurrentUserID(); @@ -66,7 +66,7 @@ class PushSubscription extends BaseApi return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray(); } - public static function put() + public function put() { self::checkAllowedScope(self::SCOPE_PUSH); $uid = self::getCurrentUserID(); @@ -99,7 +99,7 @@ class PushSubscription extends BaseApi return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray(); } - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_PUSH); $uid = self::getCurrentUserID(); @@ -112,7 +112,7 @@ class PushSubscription extends BaseApi System::jsonExit([]); } - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_PUSH); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/ScheduledStatuses.php b/src/Module/Api/Mastodon/ScheduledStatuses.php index 6a4971860..b22929381 100644 --- a/src/Module/Api/Mastodon/ScheduledStatuses.php +++ b/src/Module/Api/Mastodon/ScheduledStatuses.php @@ -34,7 +34,7 @@ use Friendica\Module\BaseApi; */ class ScheduledStatuses extends BaseApi { - public static function put() + public function put() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -42,7 +42,7 @@ class ScheduledStatuses extends BaseApi DI::apiResponse()->unsupported(Router::PUT); } - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -63,7 +63,7 @@ class ScheduledStatuses extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Search.php b/src/Module/Api/Mastodon/Search.php index d17db271f..dc7c856ac 100644 --- a/src/Module/Api/Mastodon/Search.php +++ b/src/Module/Api/Mastodon/Search.php @@ -40,7 +40,7 @@ class Search extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 75e22802e..8ffeef07a 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -41,7 +41,7 @@ use Friendica\Util\Images; */ class Statuses extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); @@ -207,7 +207,7 @@ class Statuses extends BaseApi DI::mstdnError()->InternalError(); } - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); @@ -231,7 +231,7 @@ class Statuses extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Bookmark.php b/src/Module/Api/Mastodon/Statuses/Bookmark.php index e12c6ecd2..4d2f096cd 100644 --- a/src/Module/Api/Mastodon/Statuses/Bookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Bookmark.php @@ -33,7 +33,7 @@ use Friendica\Module\BaseApi; */ class Bookmark extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Card.php b/src/Module/Api/Mastodon/Statuses/Card.php index 3c8cf706e..698dfab8c 100644 --- a/src/Module/Api/Mastodon/Statuses/Card.php +++ b/src/Module/Api/Mastodon/Statuses/Card.php @@ -35,7 +35,7 @@ class Card extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Context.php b/src/Module/Api/Mastodon/Statuses/Context.php index b8a800721..da59bb1d9 100644 --- a/src/Module/Api/Mastodon/Statuses/Context.php +++ b/src/Module/Api/Mastodon/Statuses/Context.php @@ -35,7 +35,7 @@ class Context extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Favourite.php b/src/Module/Api/Mastodon/Statuses/Favourite.php index 00844c544..3fe55807b 100644 --- a/src/Module/Api/Mastodon/Statuses/Favourite.php +++ b/src/Module/Api/Mastodon/Statuses/Favourite.php @@ -33,7 +33,7 @@ use Friendica\Module\BaseApi; */ class Favourite extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php index 5a1a6116a..b6726cc54 100644 --- a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php +++ b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php @@ -35,7 +35,7 @@ class FavouritedBy extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Mute.php b/src/Module/Api/Mastodon/Statuses/Mute.php index f9200197f..739126d58 100644 --- a/src/Module/Api/Mastodon/Statuses/Mute.php +++ b/src/Module/Api/Mastodon/Statuses/Mute.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Mute extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Pin.php b/src/Module/Api/Mastodon/Statuses/Pin.php index bf6f5bb39..b7573fd9d 100644 --- a/src/Module/Api/Mastodon/Statuses/Pin.php +++ b/src/Module/Api/Mastodon/Statuses/Pin.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Pin extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Reblog.php b/src/Module/Api/Mastodon/Statuses/Reblog.php index 0bba905f7..136491bf2 100644 --- a/src/Module/Api/Mastodon/Statuses/Reblog.php +++ b/src/Module/Api/Mastodon/Statuses/Reblog.php @@ -35,7 +35,7 @@ use Friendica\Module\BaseApi; */ class Reblog extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php index 06431969a..de2004b86 100644 --- a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php +++ b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php @@ -35,7 +35,7 @@ class RebloggedBy extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Unbookmark.php b/src/Module/Api/Mastodon/Statuses/Unbookmark.php index 0ddc5891d..d6bd6fcc8 100644 --- a/src/Module/Api/Mastodon/Statuses/Unbookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Unbookmark.php @@ -33,7 +33,7 @@ use Friendica\Module\BaseApi; */ class Unbookmark extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Unfavourite.php b/src/Module/Api/Mastodon/Statuses/Unfavourite.php index 4d6460d44..244b38cd1 100644 --- a/src/Module/Api/Mastodon/Statuses/Unfavourite.php +++ b/src/Module/Api/Mastodon/Statuses/Unfavourite.php @@ -33,7 +33,7 @@ use Friendica\Module\BaseApi; */ class Unfavourite extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Unmute.php b/src/Module/Api/Mastodon/Statuses/Unmute.php index 715462880..a659b5b07 100644 --- a/src/Module/Api/Mastodon/Statuses/Unmute.php +++ b/src/Module/Api/Mastodon/Statuses/Unmute.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Unmute extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Unpin.php b/src/Module/Api/Mastodon/Statuses/Unpin.php index 80afaf701..1eaf73409 100644 --- a/src/Module/Api/Mastodon/Statuses/Unpin.php +++ b/src/Module/Api/Mastodon/Statuses/Unpin.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Unpin extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Statuses/Unreblog.php b/src/Module/Api/Mastodon/Statuses/Unreblog.php index f00d76255..234d1058f 100644 --- a/src/Module/Api/Mastodon/Statuses/Unreblog.php +++ b/src/Module/Api/Mastodon/Statuses/Unreblog.php @@ -35,7 +35,7 @@ use Friendica\Module\BaseApi; */ class Unreblog extends BaseApi { - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Suggestions.php b/src/Module/Api/Mastodon/Suggestions.php index e7999040b..b80c239f6 100644 --- a/src/Module/Api/Mastodon/Suggestions.php +++ b/src/Module/Api/Mastodon/Suggestions.php @@ -34,7 +34,7 @@ class Suggestions extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Timelines/Direct.php b/src/Module/Api/Mastodon/Timelines/Direct.php index 5f8a2e0d7..d50c97f47 100644 --- a/src/Module/Api/Mastodon/Timelines/Direct.php +++ b/src/Module/Api/Mastodon/Timelines/Direct.php @@ -35,7 +35,7 @@ class Direct extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Timelines/Home.php b/src/Module/Api/Mastodon/Timelines/Home.php index 7b53171e1..de21bb2a1 100644 --- a/src/Module/Api/Mastodon/Timelines/Home.php +++ b/src/Module/Api/Mastodon/Timelines/Home.php @@ -36,7 +36,7 @@ class Home extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Timelines/ListTimeline.php b/src/Module/Api/Mastodon/Timelines/ListTimeline.php index 9e3219038..6d5815311 100644 --- a/src/Module/Api/Mastodon/Timelines/ListTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/ListTimeline.php @@ -36,7 +36,7 @@ class ListTimeline extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php index aa55310a7..162236d1e 100644 --- a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php @@ -39,7 +39,7 @@ class PublicTimeline extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Timelines/Tag.php b/src/Module/Api/Mastodon/Timelines/Tag.php index 3d87e0094..80ccf5a9c 100644 --- a/src/Module/Api/Mastodon/Timelines/Tag.php +++ b/src/Module/Api/Mastodon/Timelines/Tag.php @@ -37,7 +37,7 @@ class Tag extends BaseApi /** * @throws HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Api/Mastodon/Trends.php b/src/Module/Api/Mastodon/Trends.php index c7bfa0289..3536e737c 100644 --- a/src/Module/Api/Mastodon/Trends.php +++ b/src/Module/Api/Mastodon/Trends.php @@ -34,7 +34,7 @@ class Trends extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $request = self::getRequest([ 'limit' => 20, // Maximum number of results to return. Defaults to 10. diff --git a/src/Module/Api/Mastodon/Unimplemented.php b/src/Module/Api/Mastodon/Unimplemented.php index d346dc757..f5f76afd5 100644 --- a/src/Module/Api/Mastodon/Unimplemented.php +++ b/src/Module/Api/Mastodon/Unimplemented.php @@ -33,7 +33,7 @@ class Unimplemented extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function delete() + public function delete() { DI::apiResponse()->unsupported(Router::DELETE); } @@ -41,7 +41,7 @@ class Unimplemented extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function patch() + public function patch() { DI::apiResponse()->unsupported(Router::PATCH); } @@ -49,7 +49,7 @@ class Unimplemented extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function post() + public function post() { DI::apiResponse()->unsupported(Router::POST); } @@ -57,7 +57,7 @@ class Unimplemented extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function put() + public function put() { DI::apiResponse()->unsupported(Router::PUT); } @@ -65,7 +65,7 @@ class Unimplemented extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { DI::apiResponse()->unsupported(Router::GET); } diff --git a/src/Module/Api/Twitter/Account/RateLimitStatus.php b/src/Module/Api/Twitter/Account/RateLimitStatus.php index 8dca51c43..fa1383b8e 100644 --- a/src/Module/Api/Twitter/Account/RateLimitStatus.php +++ b/src/Module/Api/Twitter/Account/RateLimitStatus.php @@ -30,7 +30,7 @@ use Friendica\Util\DateTimeFormat; */ class RateLimitStatus extends BaseApi { - public static function rawContent() + public function rawContent() { if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) { $hash = [ diff --git a/src/Module/Api/Twitter/ContactEndpoint.php b/src/Module/Api/Twitter/ContactEndpoint.php index ddbbfc027..39e6d2d45 100644 --- a/src/Module/Api/Twitter/ContactEndpoint.php +++ b/src/Module/Api/Twitter/ContactEndpoint.php @@ -35,7 +35,7 @@ abstract class ContactEndpoint extends BaseApi const DEFAULT_COUNT = 20; const MAX_COUNT = 200; - public static function init() + public function init() { parent::init(); diff --git a/src/Module/Api/Twitter/FollowersIds.php b/src/Module/Api/Twitter/FollowersIds.php index 0318b5a68..f4287dc44 100644 --- a/src/Module/Api/Twitter/FollowersIds.php +++ b/src/Module/Api/Twitter/FollowersIds.php @@ -29,7 +29,7 @@ use Friendica\Model\Contact; */ class FollowersIds extends ContactEndpoint { - public static function rawContent() + public function rawContent() { // Expected value for user_id parameter: public/user contact id $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT); diff --git a/src/Module/Api/Twitter/FollowersList.php b/src/Module/Api/Twitter/FollowersList.php index 53e56e88e..72d2bbdcb 100644 --- a/src/Module/Api/Twitter/FollowersList.php +++ b/src/Module/Api/Twitter/FollowersList.php @@ -29,7 +29,7 @@ use Friendica\Model\Contact; */ class FollowersList extends ContactEndpoint { - public static function rawContent() + public function rawContent() { // Expected value for user_id parameter: public/user contact id $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT); diff --git a/src/Module/Api/Twitter/FriendsIds.php b/src/Module/Api/Twitter/FriendsIds.php index 4df2f7068..e3e9a35a3 100644 --- a/src/Module/Api/Twitter/FriendsIds.php +++ b/src/Module/Api/Twitter/FriendsIds.php @@ -29,7 +29,7 @@ use Friendica\Model\Contact; */ class FriendsIds extends ContactEndpoint { - public static function rawContent() + public function rawContent() { // Expected value for user_id parameter: public/user contact id $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT); diff --git a/src/Module/Api/Twitter/FriendsList.php b/src/Module/Api/Twitter/FriendsList.php index 59ae03601..764bfd807 100644 --- a/src/Module/Api/Twitter/FriendsList.php +++ b/src/Module/Api/Twitter/FriendsList.php @@ -29,7 +29,7 @@ use Friendica\Model\Contact; */ class FriendsList extends ContactEndpoint { - public static function rawContent() + public function rawContent() { // Expected value for user_id parameter: public/user contact id $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT); diff --git a/src/Module/Api/Twitter/SavedSearches.php b/src/Module/Api/Twitter/SavedSearches.php index d978af807..8c513a960 100644 --- a/src/Module/Api/Twitter/SavedSearches.php +++ b/src/Module/Api/Twitter/SavedSearches.php @@ -31,7 +31,7 @@ use Friendica\Module\BaseApi; */ class SavedSearches extends BaseApi { - public static function rawContent() + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); diff --git a/src/Module/Apps.php b/src/Module/Apps.php index dc3d1d10d..1d6144f16 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -31,7 +31,7 @@ use Friendica\DI; */ class Apps extends BaseModule { - public static function init() + public function init() { $privateaddons = DI::config()->get('config', 'private_addons'); if ($privateaddons === "1" && !local_user()) { @@ -39,7 +39,7 @@ class Apps extends BaseModule } } - public static function content() + public function content(): string { $apps = Nav::getAppMenu(); diff --git a/src/Module/Attach.php b/src/Module/Attach.php index 4f9da85c9..84961ca27 100644 --- a/src/Module/Attach.php +++ b/src/Module/Attach.php @@ -34,7 +34,7 @@ class Attach extends BaseModule /** * Return to user an attached file given the id */ - public static function rawContent() + public function rawContent() { $a = DI::app(); if (empty(static::$parameters['item'])) { diff --git a/src/Module/BaseAdmin.php b/src/Module/BaseAdmin.php index 822b6bdf5..83e3ca0b1 100644 --- a/src/Module/BaseAdmin.php +++ b/src/Module/BaseAdmin.php @@ -68,7 +68,7 @@ abstract class BaseAdmin extends BaseModule } } - public static function content() + public function content(): string { self::checkAdminAccess(true); diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index b42e9462d..87a690814 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -53,7 +53,7 @@ class BaseApi extends BaseModule */ protected static $request = []; - public static function delete() + public function delete() { self::checkAllowedScope(self::SCOPE_WRITE); @@ -62,7 +62,7 @@ class BaseApi extends BaseModule } } - public static function patch() + public function patch() { self::checkAllowedScope(self::SCOPE_WRITE); @@ -71,7 +71,7 @@ class BaseApi extends BaseModule } } - public static function post() + public function post() { self::checkAllowedScope(self::SCOPE_WRITE); @@ -80,7 +80,7 @@ class BaseApi extends BaseModule } } - public static function put() + public function put() { self::checkAllowedScope(self::SCOPE_WRITE); diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php index 3987c9056..685337699 100644 --- a/src/Module/BaseNotifications.php +++ b/src/Module/BaseNotifications.php @@ -82,7 +82,7 @@ abstract class BaseNotifications extends BaseModule */ abstract public static function getNotifications(); - public static function init() + public function init() { if (!local_user()) { throw new ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -94,7 +94,7 @@ abstract class BaseNotifications extends BaseModule self::$showAll = ($_REQUEST['show'] ?? '') === 'all'; } - public static function rawContent() + public function rawContent() { // If the last argument of the query is NOT json, return if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') { diff --git a/src/Module/BaseSettings.php b/src/Module/BaseSettings.php index 1a20fc3dc..7afaa35d0 100644 --- a/src/Module/BaseSettings.php +++ b/src/Module/BaseSettings.php @@ -28,7 +28,7 @@ use Friendica\DI; class BaseSettings extends BaseModule { - public static function content() + public function content(): string { $a = DI::app(); @@ -125,5 +125,7 @@ class BaseSettings extends BaseModule '$class' => 'settings-widget', '$items' => $tabs, ]); + + return ''; } } diff --git a/src/Module/Bookmarklet.php b/src/Module/Bookmarklet.php index 408fb50b2..5061254aa 100644 --- a/src/Module/Bookmarklet.php +++ b/src/Module/Bookmarklet.php @@ -34,7 +34,7 @@ use Friendica\Util\Strings; */ class Bookmarklet extends BaseModule { - public static function content() + public function content(): string { $_GET['mode'] = 'minimal'; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d80abe470..243ec4be3 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -96,7 +96,7 @@ class Contact extends BaseModule DI::baseUrl()->redirect($redirectUrl); } - public static function post() + public function post() { if (!local_user()) { return; @@ -226,7 +226,7 @@ class Contact extends BaseModule Model\Contact\User::setIgnored($contact_id, local_user(), $ignored); } - public static function content($update = 0) + public function content($update = 0): string { if (!local_user()) { return Login::form($_SERVER['REQUEST_URI']); diff --git a/src/Module/Contact/Advanced.php b/src/Module/Contact/Advanced.php index 521e4f469..53ab31d1a 100644 --- a/src/Module/Contact/Advanced.php +++ b/src/Module/Contact/Advanced.php @@ -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']; diff --git a/src/Module/Contact/Contacts.php b/src/Module/Contact/Contacts.php index 1e3e582c0..b5b501d6e 100644 --- a/src/Module/Contact/Contacts.php +++ b/src/Module/Contact/Contacts.php @@ -14,7 +14,7 @@ use Friendica\Network\HTTPException; class Contacts extends BaseModule { - public static function content() + public function content(): string { $app = DI::app(); diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php index 2de1a0f8a..34560313d 100644 --- a/src/Module/Contact/Hovercard.php +++ b/src/Module/Contact/Hovercard.php @@ -35,7 +35,7 @@ use Friendica\Util\Strings; */ class Hovercard extends BaseModule { - public static function rawContent() + public function rawContent() { $contact_url = $_REQUEST['url'] ?? ''; diff --git a/src/Module/Contact/Media.php b/src/Module/Contact/Media.php index d854aa9d6..d9a039957 100644 --- a/src/Module/Contact/Media.php +++ b/src/Module/Contact/Media.php @@ -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']; diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index 7f3e596db..215e32258 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -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.')); diff --git a/src/Module/Contact/Revoke.php b/src/Module/Contact/Revoke.php index 5730d569a..1cace6255 100644 --- a/src/Module/Contact/Revoke.php +++ b/src/Module/Contact/Revoke.php @@ -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']); diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php index 9a6e0709f..58a0c5750 100644 --- a/src/Module/Conversation/Community.php +++ b/src/Module/Conversation/Community.php @@ -49,7 +49,7 @@ class Community extends BaseModule protected static $max_id; protected static $item_id; - public static function content() + public function content(): string { self::parseRequest(); diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index 87bce1030..06fec9ee7 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -57,7 +57,7 @@ class Network extends BaseModule /** @var string */ protected static $order; - public static function content() + public function content(): string { if (!local_user()) { return Login::form(); diff --git a/src/Module/Credits.php b/src/Module/Credits.php index cf3a4ca34..fdd4f6974 100644 --- a/src/Module/Credits.php +++ b/src/Module/Credits.php @@ -32,7 +32,7 @@ use Friendica\DI; */ class Credits extends BaseModule { - public static function content() + public function content(): string { /* fill the page with credits */ $credits_string = file_get_contents('CREDITS.txt'); diff --git a/src/Module/DFRN/Notify.php b/src/Module/DFRN/Notify.php index a02913ada..cbd658fc9 100644 --- a/src/Module/DFRN/Notify.php +++ b/src/Module/DFRN/Notify.php @@ -38,7 +38,7 @@ use Friendica\Network\HTTPException; */ class Notify extends BaseModule { - public static function post() + public function post() { $postdata = Network::postdata(); diff --git a/src/Module/DFRN/Poll.php b/src/Module/DFRN/Poll.php index 9a2ab4b69..3c4becdd6 100644 --- a/src/Module/DFRN/Poll.php +++ b/src/Module/DFRN/Poll.php @@ -29,7 +29,7 @@ use Friendica\Protocol\OStatus; */ class Poll extends BaseModule { - public static function rawContent() + public function rawContent() { header("Content-type: application/atom+xml"); $last_update = $_GET['last_update'] ?? ''; diff --git a/src/Module/Debug/ActivityPubConversion.php b/src/Module/Debug/ActivityPubConversion.php index 2a06a672c..7f5fa6274 100644 --- a/src/Module/Debug/ActivityPubConversion.php +++ b/src/Module/Debug/ActivityPubConversion.php @@ -34,7 +34,7 @@ use Friendica\Util\XML; class ActivityPubConversion extends BaseModule { - public static function content() + public function content(): string { function visible_whitespace($s) { diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php index 4901684b6..c50bd08d7 100644 --- a/src/Module/Debug/Babel.php +++ b/src/Module/Debug/Babel.php @@ -35,7 +35,7 @@ use Friendica\Util\XML; */ class Babel extends BaseModule { - public static function content() + public function content(): string { function visible_whitespace($s) { diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php index 0c0c0ded4..2d2a7dc54 100644 --- a/src/Module/Debug/Feed.php +++ b/src/Module/Debug/Feed.php @@ -32,7 +32,7 @@ use Friendica\Protocol; */ class Feed extends BaseModule { - public static function init() + public function init() { if (!local_user()) { notice(DI::l10n()->t('You must be logged in to use this module')); @@ -40,7 +40,7 @@ class Feed extends BaseModule } } - public static function content() + public function content(): string { $result = []; if (!empty($_REQUEST['url'])) { diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php index 703089646..04dab22c6 100644 --- a/src/Module/Debug/ItemBody.php +++ b/src/Module/Debug/ItemBody.php @@ -31,7 +31,7 @@ use Friendica\Network\HTTPException; */ class ItemBody extends BaseModule { - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.')); diff --git a/src/Module/Debug/Localtime.php b/src/Module/Debug/Localtime.php index 2d784765d..6fb91380a 100644 --- a/src/Module/Debug/Localtime.php +++ b/src/Module/Debug/Localtime.php @@ -31,7 +31,7 @@ class Localtime extends BaseModule { static $mod_localtime = ''; - public static function post() + public function post() { $time = ($_REQUEST['time'] ?? '') ?: 'now'; @@ -42,7 +42,7 @@ class Localtime extends BaseModule } } - public static function content() + public function content(): string { $time = ($_REQUEST['time'] ?? '') ?: 'now'; diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php index 24c8d745c..fcb7dda21 100644 --- a/src/Module/Debug/Probe.php +++ b/src/Module/Debug/Probe.php @@ -32,7 +32,7 @@ use Friendica\Network\Probe as NetworkProbe; */ class Probe extends BaseModule { - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php index f95d7a2b9..4527d2fb2 100644 --- a/src/Module/Debug/WebFinger.php +++ b/src/Module/Debug/WebFinger.php @@ -31,7 +31,7 @@ use Friendica\Network\Probe; */ class WebFinger extends BaseModule { - public static function content() + public function content(): string { if (!local_user()) { throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index b4845764c..2b36fc2a3 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -37,7 +37,7 @@ use Friendica\Util\Proxy; */ class Delegation extends BaseModule { - public static function post() + public function post() { if (!local_user()) { return; @@ -112,7 +112,7 @@ class Delegation extends BaseModule // NOTREACHED } - public static function content() + public function content(): string { if (!local_user()) { throw new ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Diaspora/Fetch.php b/src/Module/Diaspora/Fetch.php index dc3e76b01..aa582558f 100644 --- a/src/Module/Diaspora/Fetch.php +++ b/src/Module/Diaspora/Fetch.php @@ -38,7 +38,7 @@ use Friendica\Util\Strings; */ class Fetch extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['guid'])) { throw new HTTPException\NotFoundException(); diff --git a/src/Module/Diaspora/Receive.php b/src/Module/Diaspora/Receive.php index 2fde1fe3f..9ac89cc6e 100644 --- a/src/Module/Diaspora/Receive.php +++ b/src/Module/Diaspora/Receive.php @@ -38,12 +38,12 @@ class Receive extends BaseModule /** @var LoggerInterface */ private static $logger; - public static function init() + public function init() { self::$logger = DI::logger(); } - public static function post() + public function post() { $enabled = DI::config()->get('system', 'diaspora_enabled', false); if (!$enabled) { diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 799b18ea1..a81780a28 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -38,7 +38,7 @@ use Friendica\Network\HTTPException; */ class Directory extends BaseModule { - public static function content() + public function content(): string { $app = DI::app(); $config = DI::config(); diff --git a/src/Module/Events/Json.php b/src/Module/Events/Json.php index befd8d7aa..566cf648a 100644 --- a/src/Module/Events/Json.php +++ b/src/Module/Events/Json.php @@ -13,7 +13,7 @@ use Friendica\Util\Temporal; class Json extends \Friendica\BaseModule { - public static function rawContent() + public function rawContent() { if (!local_user()) { throw new HTTPException\UnauthorizedException(); diff --git a/src/Module/Feed.php b/src/Module/Feed.php index 0eca46b1a..94908abe2 100644 --- a/src/Module/Feed.php +++ b/src/Module/Feed.php @@ -41,7 +41,7 @@ use Friendica\Protocol\Feed as ProtocolFeed; */ class Feed extends BaseModule { - public static function content() + public function content(): string { $a = DI::app(); diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php index e52db81c1..43a0ff1fb 100644 --- a/src/Module/Filer/RemoveTag.php +++ b/src/Module/Filer/RemoveTag.php @@ -33,7 +33,7 @@ use Friendica\Util\XML; */ class RemoveTag extends BaseModule { - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\ForbiddenException(); @@ -62,7 +62,7 @@ class RemoveTag extends BaseModule if ($item_id && strlen($term)) { $item = Post::selectFirst(['uri-id'], ['id' => $item_id]); if (!DBA::isResult($item)) { - return; + return ''; } if (!Post\Category::deleteFileByURIId($item['uri-id'], local_user(), $type, $term)) { notice(DI::l10n()->t('Item was not removed')); @@ -74,5 +74,7 @@ class RemoveTag extends BaseModule if ($type == Post\Category::FILE) { DI::baseUrl()->redirect('filed?file=' . rawurlencode($term)); } + + return ''; } } diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 363e51c21..ee620f54c 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -34,7 +34,7 @@ use Friendica\Util\XML; */ class SaveTag extends BaseModule { - public static function init() + public function init() { if (!local_user()) { notice(DI::l10n()->t('You must be logged in to use this module')); @@ -42,7 +42,7 @@ class SaveTag extends BaseModule } } - public static function rawContent() + public function rawContent() { $logger = DI::logger(); diff --git a/src/Module/FollowConfirm.php b/src/Module/FollowConfirm.php index 6e6b4da1d..41f811698 100644 --- a/src/Module/FollowConfirm.php +++ b/src/Module/FollowConfirm.php @@ -10,7 +10,7 @@ use Friendica\Model\Contact; */ class FollowConfirm extends BaseModule { - public static function post() + public function post() { $uid = local_user(); if (!$uid) { diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php index 3256a04c2..cc4041a6f 100644 --- a/src/Module/FriendSuggest.php +++ b/src/Module/FriendSuggest.php @@ -38,14 +38,14 @@ use Friendica\Worker\Delivery; */ class FriendSuggest extends BaseModule { - public static function init() + public function init() { if (!local_user()) { throw new ForbiddenException(DI::l10n()->t('Permission denied.')); } } - public static function post() + public function post() { $cid = intval(static::$parameters['contact']); @@ -83,7 +83,7 @@ class FriendSuggest extends BaseModule info(DI::l10n()->t('Friend suggestion sent.')); } - public static function content() + public function content(): string { $cid = intval(static::$parameters['contact']); diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 082c5c081..b4de151e9 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -38,7 +38,7 @@ use Friendica\Protocol\ActivityPub; */ class Friendica extends BaseModule { - public static function content() + public function content(): string { $config = DI::config(); @@ -110,7 +110,7 @@ class Friendica extends BaseModule ]); } - public static function rawContent() + public function rawContent() { if (ActivityPub::isRequest()) { try { diff --git a/src/Module/Group.php b/src/Module/Group.php index 69baef9f4..1750d3e04 100644 --- a/src/Module/Group.php +++ b/src/Module/Group.php @@ -32,7 +32,7 @@ require_once 'boot.php'; class Group extends BaseModule { - public static function post() + public function post() { $a = DI::app(); @@ -138,7 +138,7 @@ class Group extends BaseModule } } - public static function content() + public function content(): string { $change = false; diff --git a/src/Module/HCard.php b/src/Module/HCard.php index 269deff06..7dabf6c69 100644 --- a/src/Module/HCard.php +++ b/src/Module/HCard.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException; */ class HCard extends BaseModule { - public static function content() + public function content(): string { if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') { // A logged in user views a profile of a user diff --git a/src/Module/HTTPException/MethodNotAllowed.php b/src/Module/HTTPException/MethodNotAllowed.php index 874583246..07aab537a 100644 --- a/src/Module/HTTPException/MethodNotAllowed.php +++ b/src/Module/HTTPException/MethodNotAllowed.php @@ -27,7 +27,7 @@ use Friendica\Network\HTTPException; class MethodNotAllowed extends BaseModule { - public static function content() + public function content(): string { throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.')); } diff --git a/src/Module/HTTPException/PageNotFound.php b/src/Module/HTTPException/PageNotFound.php index 5ba546624..6af5e91ae 100644 --- a/src/Module/HTTPException/PageNotFound.php +++ b/src/Module/HTTPException/PageNotFound.php @@ -27,7 +27,7 @@ use Friendica\Network\HTTPException; class PageNotFound extends BaseModule { - public static function content() + public function content(): string { throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.')); } diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index aebe15dd0..8910d9cce 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -31,7 +31,7 @@ use Friendica\Util\Strings; */ class Hashtag extends BaseModule { - public static function content() + public function content(): string { $result = []; @@ -47,5 +47,7 @@ class Hashtag extends BaseModule DBA::close($taglist); System::jsonExit($result); + + return ''; } } diff --git a/src/Module/Help.php b/src/Module/Help.php index 5440fd97d..64ba68f5c 100644 --- a/src/Module/Help.php +++ b/src/Module/Help.php @@ -32,7 +32,7 @@ use Friendica\Network\HTTPException; */ class Help extends BaseModule { - public static function content() + public function content(): string { Nav::setSelected('help'); diff --git a/src/Module/Home.php b/src/Module/Home.php index 719d87452..f4e6b9733 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -32,7 +32,7 @@ use Friendica\Module\Security\Login; */ class Home extends BaseModule { - public static function content() + public function content(): string { $app = DI::app(); $config = DI::config(); diff --git a/src/Module/Install.php b/src/Module/Install.php index 72b83ebff..8f872c683 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -65,7 +65,7 @@ class Install extends BaseModule */ private static $installer; - public static function init() + public function init() { $a = DI::app(); @@ -94,7 +94,7 @@ class Install extends BaseModule self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK; } - public static function post() + public function post() { $a = DI::app(); $configCache = $a->getConfigCache(); @@ -177,7 +177,7 @@ class Install extends BaseModule } } - public static function content() + public function content(): string { $a = DI::app(); $configCache = $a->getConfigCache(); diff --git a/src/Module/Invite.php b/src/Module/Invite.php index 3c82a26c1..10346a516 100644 --- a/src/Module/Invite.php +++ b/src/Module/Invite.php @@ -35,7 +35,7 @@ use Friendica\Util\Strings; */ class Invite extends BaseModule { - public static function post() + public function post() { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -124,7 +124,7 @@ class Invite extends BaseModule info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total)); } - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Item/Activity.php b/src/Module/Item/Activity.php index 6006be9c7..b92b0acf6 100644 --- a/src/Module/Item/Activity.php +++ b/src/Module/Item/Activity.php @@ -38,7 +38,7 @@ use Friendica\Network\HTTPException; */ class Activity extends BaseModule { - public static function rawContent() + public function rawContent() { if (!Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(); diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index c229fb15a..7867b9858 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -40,7 +40,7 @@ use Friendica\Util\Temporal; class Compose extends BaseModule { - public static function post() + public function post() { if (!empty($_REQUEST['body'])) { $_REQUEST['return'] = 'network'; @@ -51,7 +51,7 @@ class Compose extends BaseModule } } - public static function content() + public function content(): string { if (!local_user()) { return Login::form('compose', false); diff --git a/src/Module/Item/Follow.php b/src/Module/Item/Follow.php index 923048447..baa99c21e 100644 --- a/src/Module/Item/Follow.php +++ b/src/Module/Item/Follow.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException; */ class Follow extends BaseModule { - public static function rawContent() + public function rawContent() { $l10n = DI::l10n(); diff --git a/src/Module/Item/Ignore.php b/src/Module/Item/Ignore.php index 19ac90e47..e38dd46bc 100644 --- a/src/Module/Item/Ignore.php +++ b/src/Module/Item/Ignore.php @@ -33,7 +33,7 @@ use Friendica\Network\HTTPException; */ class Ignore extends BaseModule { - public static function rawContent() + public function rawContent() { $l10n = DI::l10n(); diff --git a/src/Module/Item/Pin.php b/src/Module/Item/Pin.php index c451bae48..185b418bb 100644 --- a/src/Module/Item/Pin.php +++ b/src/Module/Item/Pin.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException; */ class Pin extends BaseModule { - public static function rawContent() + public function rawContent() { $l10n = DI::l10n(); diff --git a/src/Module/Item/Star.php b/src/Module/Item/Star.php index d24fb54ac..336207718 100644 --- a/src/Module/Item/Star.php +++ b/src/Module/Item/Star.php @@ -35,7 +35,7 @@ use Friendica\Network\HTTPException; */ class Star extends BaseModule { - public static function rawContent() + public function rawContent() { $l10n = DI::l10n(); diff --git a/src/Module/Magic.php b/src/Module/Magic.php index 63f8ee9c1..af9e5084a 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -39,7 +39,7 @@ use Friendica\Util\Strings; */ class Magic extends BaseModule { - public static function init() + public function init() { $a = DI::app(); $ret = ['success' => false, 'url' => '', 'message' => '']; diff --git a/src/Module/Maintenance.php b/src/Module/Maintenance.php index d13c5fe02..2025a5fa4 100644 --- a/src/Module/Maintenance.php +++ b/src/Module/Maintenance.php @@ -34,7 +34,7 @@ use Friendica\Util\Strings; */ class Maintenance extends BaseModule { - public static function content() + public function content(): string { $reason = DI::config()->get('system', 'maintenance_reason'); diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php index 4a226ac63..ff462fd3e 100644 --- a/src/Module/Manifest.php +++ b/src/Module/Manifest.php @@ -27,7 +27,7 @@ use Friendica\DI; class Manifest extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 96e4d7658..c5a66c9bb 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -35,7 +35,7 @@ use Friendica\Model\User; */ class NoScrape extends BaseModule { - public static function rawContent() + public function rawContent() { $a = DI::app(); diff --git a/src/Module/NodeInfo110.php b/src/Module/NodeInfo110.php index 3923b7e21..d8f8a5049 100644 --- a/src/Module/NodeInfo110.php +++ b/src/Module/NodeInfo110.php @@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo; */ class NodeInfo110 extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/NodeInfo120.php b/src/Module/NodeInfo120.php index 471f0f212..aac8c6d4f 100644 --- a/src/Module/NodeInfo120.php +++ b/src/Module/NodeInfo120.php @@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo; */ class NodeInfo120 extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/NodeInfo210.php b/src/Module/NodeInfo210.php index 02324a92b..cb55411f2 100644 --- a/src/Module/NodeInfo210.php +++ b/src/Module/NodeInfo210.php @@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo; */ class NodeInfo210 extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php index 234175dd8..7379510d8 100644 --- a/src/Module/Notifications/Introductions.php +++ b/src/Module/Notifications/Introductions.php @@ -55,7 +55,7 @@ class Introductions extends BaseNotifications ]; } - public static function content() + public function content(): string { Nav::setSelected('introductions'); diff --git a/src/Module/Notifications/Notification.php b/src/Module/Notifications/Notification.php index 5c27abbbb..1ceafc105 100644 --- a/src/Module/Notifications/Notification.php +++ b/src/Module/Notifications/Notification.php @@ -42,7 +42,7 @@ class Notification extends BaseModule * @throws \ImagickException * @throws \Exception */ - public static function post() + public function post() { if (!local_user()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.')); @@ -73,7 +73,7 @@ class Notification extends BaseModule * * @throws HTTPException\UnauthorizedException */ - public static function rawContent() + public function rawContent() { if (!local_user()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.')); @@ -101,7 +101,7 @@ class Notification extends BaseModule * @throws HTTPException\InternalServerErrorException * @throws \Exception */ - public static function content(): string + public function content(): string { if (!local_user()) { notice(DI::l10n()->t('You must be logged in to show this page.')); diff --git a/src/Module/Notifications/Notifications.php b/src/Module/Notifications/Notifications.php index 9b43647e9..eef4af9bc 100644 --- a/src/Module/Notifications/Notifications.php +++ b/src/Module/Notifications/Notifications.php @@ -82,7 +82,7 @@ class Notifications extends BaseNotifications ]; } - public static function content() + public function content(): string { Nav::setSelected('notifications'); diff --git a/src/Module/OAuth/Acknowledge.php b/src/Module/OAuth/Acknowledge.php index ffce1caae..f0915df41 100644 --- a/src/Module/OAuth/Acknowledge.php +++ b/src/Module/OAuth/Acknowledge.php @@ -30,13 +30,13 @@ use Friendica\Module\BaseApi; */ class Acknowledge extends BaseApi { - public static function post() + public function post() { DI::session()->set('oauth_acknowledge', true); DI::app()->redirect(DI::session()->get('return_path')); } - public static function content() + public function content(): string { DI::session()->set('return_path', $_REQUEST['return_path'] ?? ''); diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php index ede46720a..d39cbe353 100644 --- a/src/Module/OAuth/Authorize.php +++ b/src/Module/OAuth/Authorize.php @@ -37,7 +37,7 @@ class Authorize extends BaseApi /** * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent() + public function rawContent() { $request = self::getRequest([ 'force_login' => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance. @@ -97,7 +97,7 @@ class Authorize extends BaseApi self::$oauth_code = $token['code']; } - public static function content() + public function content(): string { if (empty(self::$oauth_code)) { return ''; diff --git a/src/Module/OAuth/Revoke.php b/src/Module/OAuth/Revoke.php index 156ef1c19..bf906ab45 100644 --- a/src/Module/OAuth/Revoke.php +++ b/src/Module/OAuth/Revoke.php @@ -32,7 +32,7 @@ use Friendica\Module\BaseApi; */ class Revoke extends BaseApi { - public static function post() + public function post() { $request = self::getRequest([ 'client_id' => '', // Client ID, obtained during app registration diff --git a/src/Module/OAuth/Token.php b/src/Module/OAuth/Token.php index 2ef26cbf1..6aef63f30 100644 --- a/src/Module/OAuth/Token.php +++ b/src/Module/OAuth/Token.php @@ -34,7 +34,7 @@ use Friendica\Security\OAuth; */ class Token extends BaseApi { - public static function post() + public function post() { $request = self::getRequest([ 'client_id' => '', // Client ID, obtained during app registration diff --git a/src/Module/Oembed.php b/src/Module/Oembed.php index 5564fdaca..1b38c0e97 100644 --- a/src/Module/Oembed.php +++ b/src/Module/Oembed.php @@ -37,7 +37,7 @@ use Friendica\Util\Strings; */ class Oembed extends BaseModule { - public static function content() + public function content(): string { // Unused form: /oembed/b2h?url=... if (DI::args()->getArgv()[1] == 'b2h') { diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index a6393726d..e5212c251 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -36,7 +36,7 @@ class OpenSearch extends BaseModule /** * @throws \Exception */ - public static function rawContent() + public function rawContent() { header('Content-type: application/opensearchdescription+xml'); diff --git a/src/Module/Owa.php b/src/Module/Owa.php index a46734987..85530df6f 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -44,7 +44,7 @@ use Friendica\Util\Strings; */ class Owa extends BaseModule { - public static function init() + public function init() { $ret = [ 'success' => false ]; diff --git a/src/Module/ParseUrl.php b/src/Module/ParseUrl.php index f8665c535..092d6ec74 100644 --- a/src/Module/ParseUrl.php +++ b/src/Module/ParseUrl.php @@ -31,7 +31,7 @@ use Friendica\Util; class ParseUrl extends BaseModule { - public static function rawContent() + public function rawContent() { if (!Session::isAuthenticated()) { throw new \Friendica\Network\HTTPException\ForbiddenException(); diff --git a/src/Module/PermissionTooltip.php b/src/Module/PermissionTooltip.php index 89ed260f9..bf0cc0d63 100644 --- a/src/Module/PermissionTooltip.php +++ b/src/Module/PermissionTooltip.php @@ -15,7 +15,7 @@ use Friendica\Network\HTTPException; */ class PermissionTooltip extends \Friendica\BaseModule { - public static function rawContent() + public function rawContent() { $type = static::$parameters['type']; $referenceId = static::$parameters['id']; diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 2a45ef047..4ea3617ac 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -51,7 +51,7 @@ class Photo extends BaseModule * Fetch a photo or an avatar, in optional size, check for permissions and * return the image */ - public static function rawContent() + public function rawContent() { $totalstamp = microtime(true); diff --git a/src/Module/Profile/Common.php b/src/Module/Profile/Common.php index a46973967..d95f2b01e 100644 --- a/src/Module/Profile/Common.php +++ b/src/Module/Profile/Common.php @@ -35,7 +35,7 @@ use Friendica\Network\HTTPException; class Common extends BaseProfile { - public static function content() + public function content(): string { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 0f28be641..d849d5778 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -34,7 +34,7 @@ use Friendica\Network\HTTPException; class Contacts extends Module\BaseProfile { - public static function content() + public function content(): string { if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); diff --git a/src/Module/Profile/Index.php b/src/Module/Profile/Index.php index 4f46efaa3..e6249f90e 100644 --- a/src/Module/Profile/Index.php +++ b/src/Module/Profile/Index.php @@ -34,13 +34,13 @@ use Friendica\BaseModule; */ class Index extends BaseModule { - public static function rawContent() + public function rawContent() { - Profile::rawContent(); + (new Profile(static::$parameters))->rawContent(); } - public static function content() + public function content(): string { - return Status::content(); + return (new Status(static::$parameters))->content(); } } diff --git a/src/Module/Profile/Media.php b/src/Module/Profile/Media.php index f46097814..0f34b267d 100644 --- a/src/Module/Profile/Media.php +++ b/src/Module/Profile/Media.php @@ -29,7 +29,7 @@ use Friendica\Network\HTTPException; class Media extends BaseProfile { - public static function content() + public function content(): string { $a = DI::app(); diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index c1792ad4e..32d3aae70 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -46,7 +46,7 @@ use Friendica\Util\Temporal; class Profile extends BaseProfile { - public static function rawContent() + public function rawContent() { if (ActivityPub::isRequest()) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]); @@ -73,7 +73,7 @@ class Profile extends BaseProfile } } - public static function content() + public function content(): string { $a = DI::app(); diff --git a/src/Module/Profile/Schedule.php b/src/Module/Profile/Schedule.php index eaeeb8540..72208fe79 100644 --- a/src/Module/Profile/Schedule.php +++ b/src/Module/Profile/Schedule.php @@ -33,7 +33,7 @@ use Friendica\Util\DateTimeFormat; class Schedule extends BaseProfile { - public static function post() + public function post() { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -50,7 +50,7 @@ class Schedule extends BaseProfile Post\Delayed::deleteById($_REQUEST['delete']); } - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 995939ce7..db5400bff 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -46,7 +46,7 @@ use Friendica\Util\XML; class Status extends BaseProfile { - public static function content() + public function content(): string { $args = DI::args(); diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index a9c8c0b9e..7a7c7b082 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -44,7 +44,7 @@ class Proxy extends BaseModule /** * Fetch remote image content */ - public static function rawContent() + public function rawContent() { $request = self::getRequestInfo(); diff --git a/src/Module/PublicRSAKey.php b/src/Module/PublicRSAKey.php index 22269984a..9df9f5857 100644 --- a/src/Module/PublicRSAKey.php +++ b/src/Module/PublicRSAKey.php @@ -33,7 +33,7 @@ use Friendica\Util\Strings; */ class PublicRSAKey extends BaseModule { - public static function rawContent() + public function rawContent() { if (empty(static::$parameters['nick'])) { throw new BadRequestException(); diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index b50746701..38cd68429 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -30,7 +30,7 @@ use Friendica\Model\Contact; */ class RandomProfile extends BaseModule { - public static function content() + public function content(): string { $a = DI::app(); @@ -42,5 +42,7 @@ class RandomProfile extends BaseModule } DI::baseUrl()->redirect('profile'); + + return ''; } } diff --git a/src/Module/ReallySimpleDiscovery.php b/src/Module/ReallySimpleDiscovery.php index 50b966002..fe071fc55 100644 --- a/src/Module/ReallySimpleDiscovery.php +++ b/src/Module/ReallySimpleDiscovery.php @@ -31,7 +31,7 @@ use Friendica\Util\XML; */ class ReallySimpleDiscovery extends BaseModule { - public static function rawContent() + public function rawContent() { header('Content-Type: text/xml'); diff --git a/src/Module/Register.php b/src/Module/Register.php index 7c0d3f690..42b95e78e 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -53,7 +53,7 @@ class Register extends BaseModule * * @return string */ - public static function content() + public function content(): string { // logged in users can register others (people/pages/groups) // even with closed registrations, unless specifically prohibited by site policy. @@ -182,7 +182,7 @@ class Register extends BaseModule * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post() + public function post() { BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register'); diff --git a/src/Module/RemoteFollow.php b/src/Module/RemoteFollow.php index df67e60c6..b6b0255fc 100644 --- a/src/Module/RemoteFollow.php +++ b/src/Module/RemoteFollow.php @@ -42,7 +42,7 @@ class RemoteFollow extends BaseModule { static $owner; - public static function init() + public function init() { self::$owner = User::getOwnerDataByNick(static::$parameters['profile']); if (!self::$owner) { @@ -52,7 +52,7 @@ class RemoteFollow extends BaseModule DI::page()['aside'] = Widget\VCard::getHTML(self::$owner); } - public static function post() + public 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() + public function content(): string { if (empty(self::$owner)) { return ''; diff --git a/src/Module/RobotsTxt.php b/src/Module/RobotsTxt.php index c2b2d624d..ec7ee086e 100644 --- a/src/Module/RobotsTxt.php +++ b/src/Module/RobotsTxt.php @@ -28,7 +28,7 @@ use Friendica\BaseModule; */ class RobotsTxt extends BaseModule { - public static function rawContent() + public function rawContent() { $allDisalloweds = [ '/settings/', diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index 8ec8dd9bb..0866b5f9a 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -48,7 +48,7 @@ class Acl extends BaseModule const TYPE_PRIVATE_MESSAGE = 'm'; const TYPE_ANY_CONTACT = 'a'; - public static function rawContent() + public function rawContent() { if (!local_user()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.')); diff --git a/src/Module/Search/Directory.php b/src/Module/Search/Directory.php index 5b5a1ba28..bbd90f137 100644 --- a/src/Module/Search/Directory.php +++ b/src/Module/Search/Directory.php @@ -31,7 +31,7 @@ use Friendica\Module\Security\Login; */ class Directory extends BaseSearch { - public static function content() + public function content(): string { if (!local_user()) { notice(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Search/Filed.php b/src/Module/Search/Filed.php index f3cad8620..519b0ece0 100644 --- a/src/Module/Search/Filed.php +++ b/src/Module/Search/Filed.php @@ -17,7 +17,7 @@ use Friendica\Module\Security\Login; class Filed extends BaseSearch { - public static function content() + public function content(): string { if (!local_user()) { return Login::form(); diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 941b4c577..2118aeaae 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -41,7 +41,7 @@ use Friendica\Network\HTTPException; class Index extends BaseSearch { - public static function content() + public function content(): string { $search = (!empty($_GET['q']) ? trim(rawurldecode($_GET['q'])) : ''); diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php index 436e3f958..43c33d544 100644 --- a/src/Module/Search/Saved.php +++ b/src/Module/Search/Saved.php @@ -28,7 +28,7 @@ use Friendica\DI; class Saved extends BaseModule { - public static function init() + public function init() { $action = DI::args()->get(2, 'none'); $search = trim(rawurldecode($_GET['term'] ?? '')); diff --git a/src/Module/Security/Login.php b/src/Module/Security/Login.php index e157ac089..5c47e9749 100644 --- a/src/Module/Security/Login.php +++ b/src/Module/Security/Login.php @@ -33,7 +33,7 @@ use Friendica\Module\Register; */ class Login extends BaseModule { - public static function content() + public function content(): string { $return_path = $_REQUEST['return_path'] ?? '' ; @@ -46,7 +46,7 @@ class Login extends BaseModule return self::form(Session::get('return_path'), intval(DI::config()->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED); } - public static function post() + public function post() { $return_path = Session::get('return_path'); Session::clear(); diff --git a/src/Module/Security/Logout.php b/src/Module/Security/Logout.php index 35658797c..604c9fc17 100644 --- a/src/Module/Security/Logout.php +++ b/src/Module/Security/Logout.php @@ -36,7 +36,7 @@ class Logout extends BaseModule /** * Process logout requests */ - public static function init() + public function init() { $visitor_home = null; if (remote_user()) { diff --git a/src/Module/Security/OpenID.php b/src/Module/Security/OpenID.php index 4459b2cf8..360c9c672 100644 --- a/src/Module/Security/OpenID.php +++ b/src/Module/Security/OpenID.php @@ -31,7 +31,7 @@ use LightOpenID; */ class OpenID extends BaseModule { - public static function content() + public function content(): string { if (DI::config()->get('system', 'no_openid')) { DI::baseUrl()->redirect(); @@ -97,5 +97,7 @@ class OpenID extends BaseModule DI::baseUrl()->redirect('login'); } } + + return ''; } } diff --git a/src/Module/Security/TwoFactor/Recovery.php b/src/Module/Security/TwoFactor/Recovery.php index 5bcf6add8..193fcb844 100644 --- a/src/Module/Security/TwoFactor/Recovery.php +++ b/src/Module/Security/TwoFactor/Recovery.php @@ -35,14 +35,14 @@ use Friendica\Security\TwoFactor\Model\RecoveryCode; */ class Recovery extends BaseModule { - public static function init() + public function init() { if (!local_user()) { return; } } - public static function post() + public function post() { if (!local_user()) { return; @@ -67,7 +67,7 @@ class Recovery extends BaseModule } } - public static function content() + public function content(): string { if (!local_user()) { DI::baseUrl()->redirect(); diff --git a/src/Module/Security/TwoFactor/Verify.php b/src/Module/Security/TwoFactor/Verify.php index 3209b3f56..3669943ba 100644 --- a/src/Module/Security/TwoFactor/Verify.php +++ b/src/Module/Security/TwoFactor/Verify.php @@ -38,7 +38,7 @@ class Verify extends BaseModule { private static $errors = []; - public static function post() + public function post() { if (!local_user()) { return; @@ -78,7 +78,7 @@ class Verify extends BaseModule } } - public static function content() + public function content(): string { if (!local_user()) { DI::baseUrl()->redirect(); diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php index f98583a2a..a2e458839 100644 --- a/src/Module/Settings/Delegation.php +++ b/src/Module/Settings/Delegation.php @@ -36,7 +36,7 @@ use Friendica\Util\Strings; */ class Delegation extends BaseSettings { - public static function post() + public function post() { if (!DI::app()->isLoggedIn()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -62,7 +62,7 @@ class Delegation extends BaseSettings DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Settings/Display.php b/src/Module/Settings/Display.php index 42632fe0f..aab8f864b 100644 --- a/src/Module/Settings/Display.php +++ b/src/Module/Settings/Display.php @@ -36,7 +36,7 @@ use Friendica\Network\HTTPException; */ class Display extends BaseSettings { - public static function post() + public function post() { if (!DI::app()->isLoggedIn()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -112,7 +112,7 @@ class Display extends BaseSettings DI::baseUrl()->redirect('settings/display'); } - public static function content() + public function content(): string { parent::content(); diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php index 8b2510050..161c440b6 100644 --- a/src/Module/Settings/Profile/Index.php +++ b/src/Module/Settings/Profile/Index.php @@ -41,7 +41,7 @@ use Friendica\Util\Temporal; class Index extends BaseSettings { - public static function post() + public function post() { if (!local_user()) { return; @@ -135,7 +135,7 @@ class Index extends BaseSettings DI::baseUrl()->redirect('settings/profile'); } - public static function content() + public function content(): string { if (!local_user()) { notice(DI::l10n()->t('You must be logged in to use this module')); diff --git a/src/Module/Settings/Profile/Photo/Crop.php b/src/Module/Settings/Profile/Photo/Crop.php index b98367438..c23361cf8 100644 --- a/src/Module/Settings/Profile/Photo/Crop.php +++ b/src/Module/Settings/Profile/Photo/Crop.php @@ -33,7 +33,7 @@ use Friendica\Network\HTTPException; class Crop extends BaseSettings { - public static function post() + public function post() { if (!Session::isAuthenticated()) { return; @@ -160,7 +160,7 @@ class Crop extends BaseSettings DI::baseUrl()->redirect($path); } - public static function content() + public function content(): string { if (!Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index 423d0971e..2e65a01c6 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -34,7 +34,7 @@ use Friendica\Util\Strings; class Index extends BaseSettings { - public static function post() + public function post() { if (!Session::isAuthenticated()) { return; @@ -106,7 +106,7 @@ class Index extends BaseSettings DI::baseUrl()->redirect('settings/profile/photo/crop/' . $resource_id); } - public static function content() + public function content(): string { if (!Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Settings/TwoFactor/AppSpecific.php b/src/Module/Settings/TwoFactor/AppSpecific.php index 21304d10e..74a9ba657 100644 --- a/src/Module/Settings/TwoFactor/AppSpecific.php +++ b/src/Module/Settings/TwoFactor/AppSpecific.php @@ -36,7 +36,7 @@ class AppSpecific extends BaseSettings { private static $appSpecificPassword = null; - public static function init() + public function init() { if (!local_user()) { return; @@ -54,7 +54,7 @@ class AppSpecific extends BaseSettings } } - public static function post() + public function post() { if (!local_user()) { return; @@ -97,7 +97,7 @@ class AppSpecific extends BaseSettings } } - public static function content() + public function content(): string { if (!local_user()) { return Login::form('settings/2fa/app_specific'); diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index b173a092d..0dcef14ad 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -33,7 +33,7 @@ use PragmaRX\Google2FA\Google2FA; class Index extends BaseSettings { - public static function post() + public function post() { if (!local_user()) { return; @@ -94,7 +94,7 @@ class Index extends BaseSettings } } - public static function content() + public function content(): string { if (!local_user()) { return Login::form('settings/2fa'); diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php index 25832d2e6..d46f6a8f5 100644 --- a/src/Module/Settings/TwoFactor/Recovery.php +++ b/src/Module/Settings/TwoFactor/Recovery.php @@ -34,7 +34,7 @@ use Friendica\Module\Security\Login; */ class Recovery extends BaseSettings { - public static function init() + public function init() { if (!local_user()) { return; @@ -52,7 +52,7 @@ class Recovery extends BaseSettings } } - public static function post() + public function post() { if (!local_user()) { return; @@ -69,7 +69,7 @@ class Recovery extends BaseSettings } } - public static function content() + public function content(): string { if (!local_user()) { return Login::form('settings/2fa/recovery'); diff --git a/src/Module/Settings/TwoFactor/Trusted.php b/src/Module/Settings/TwoFactor/Trusted.php index c719dc581..d1e0c177a 100644 --- a/src/Module/Settings/TwoFactor/Trusted.php +++ b/src/Module/Settings/TwoFactor/Trusted.php @@ -14,7 +14,7 @@ use UAParser\Parser; */ class Trusted extends BaseSettings { - public static function init() + public function init() { if (!local_user()) { return; @@ -32,7 +32,7 @@ class Trusted extends BaseSettings } } - public static function post() + public function post() { if (!local_user()) { return; @@ -64,7 +64,7 @@ class Trusted extends BaseSettings } - public static function content(): string + public function content(): string { parent::content(); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 27c9631d4..18aa6ca9f 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -39,7 +39,7 @@ use PragmaRX\Google2FA\Google2FA; */ class Verify extends BaseSettings { - public static function init() + public function init() { if (!local_user()) { return; @@ -58,7 +58,7 @@ class Verify extends BaseSettings } } - public static function post() + public function post() { if (!local_user()) { return; @@ -84,7 +84,7 @@ class Verify extends BaseSettings } } - public static function content() + public function content(): string { if (!local_user()) { return Login::form('settings/2fa/verify'); diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index 27e82c4cf..b5d79c4af 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -51,7 +51,7 @@ class UserExport extends BaseSettings * @throws HTTPException\ForbiddenException * @throws HTTPException\InternalServerErrorException */ - public static function content() + public function content(): string { if (!local_user()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); @@ -85,7 +85,7 @@ class UserExport extends BaseSettings * * @throws HTTPException\ForbiddenException */ - public static function rawContent() + public function rawContent() { if (!DI::app()->isLoggedIn()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); diff --git a/src/Module/Smilies.php b/src/Module/Smilies.php index 1ffff65c0..ded798005 100644 --- a/src/Module/Smilies.php +++ b/src/Module/Smilies.php @@ -33,7 +33,7 @@ use Friendica\DI; */ class Smilies extends BaseModule { - public static function rawContent() + public function rawContent() { if (!empty(DI::args()->getArgv()[1]) && (DI::args()->getArgv()[1] === "json")) { $smilies = Content\Smilies::getList(); @@ -45,7 +45,7 @@ class Smilies extends BaseModule } } - public static function content() + public function content(): string { $smilies = Content\Smilies::getList(); $count = count($smilies['texts'] ?? []); diff --git a/src/Module/Special/HTTPException.php b/src/Module/Special/HTTPException.php index 3b771c3ac..44f48ff2e 100644 --- a/src/Module/Special/HTTPException.php +++ b/src/Module/Special/HTTPException.php @@ -65,7 +65,7 @@ class HTTPException * @param \Friendica\Network\HTTPException $e * @throws \Exception */ - public static function rawContent(\Friendica\Network\HTTPException $e) + public function rawContent(\Friendica\Network\HTTPException $e) { $content = ''; @@ -84,7 +84,7 @@ class HTTPException * @return string * @throws \Exception */ - public static function content(\Friendica\Network\HTTPException $e) + public function content(\Friendica\Network\HTTPException $e): string { header($_SERVER["SERVER_PROTOCOL"] . ' ' . $e->getCode() . ' ' . $e->getDescription()); diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index 6b6e43165..a78031c36 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -28,14 +28,14 @@ use Friendica\Network\HTTPException\NotFoundException; class Statistics extends BaseModule { - public static function init() + public function init() { if (!DI::config()->get("system", "nodeinfo")) { throw new NotFoundException(); } } - public static function rawContent() + public function rawContent() { $config = DI::config(); $logger = DI::logger(); diff --git a/src/Module/Theme.php b/src/Module/Theme.php index 201558ab7..cd393d641 100644 --- a/src/Module/Theme.php +++ b/src/Module/Theme.php @@ -30,7 +30,7 @@ use Friendica\Util\Strings; */ class Theme extends BaseModule { - public static function rawContent() + public function rawContent() { header('Content-Type: text/css'); diff --git a/src/Module/ThemeDetails.php b/src/Module/ThemeDetails.php index 0f45af13c..5b931e117 100644 --- a/src/Module/ThemeDetails.php +++ b/src/Module/ThemeDetails.php @@ -29,7 +29,7 @@ use Friendica\Core\Theme; */ class ThemeDetails extends BaseModule { - public static function rawContent() + public function rawContent() { if (!empty($_REQUEST['theme'])) { $theme = $_REQUEST['theme']; diff --git a/src/Module/ToggleMobile.php b/src/Module/ToggleMobile.php index 7cf53633a..a0fb2f88f 100644 --- a/src/Module/ToggleMobile.php +++ b/src/Module/ToggleMobile.php @@ -29,7 +29,7 @@ use Friendica\DI; */ class ToggleMobile extends BaseModule { - public static function content() + public function content(): string { $a = DI::app(); @@ -46,5 +46,7 @@ class ToggleMobile extends BaseModule } $a->redirect($address); + + return ''; } } diff --git a/src/Module/Tos.php b/src/Module/Tos.php index 1c91641f5..8357ead18 100644 --- a/src/Module/Tos.php +++ b/src/Module/Tos.php @@ -60,7 +60,7 @@ class Tos extends BaseModule * dealings with their own node so a TOS is not necessary. * **/ - public static function init() + public function init() { if (strlen(DI::config()->get('system','singleuser'))) { DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser')); @@ -79,7 +79,7 @@ class Tos extends BaseModule * @return string * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function content() { + public function content(): string { $tpl = Renderer::getMarkupTemplate('tos.tpl'); if (DI::config()->get('system', 'tosdisplay')) { return Renderer::replaceMacros($tpl, [ diff --git a/src/Module/Update/Community.php b/src/Module/Update/Community.php index 84d2b3a9f..f42274953 100644 --- a/src/Module/Update/Community.php +++ b/src/Module/Update/Community.php @@ -33,7 +33,7 @@ use Friendica\Module\Conversation\Community as CommunityModule; */ class Community extends CommunityModule { - public static function rawContent() + public function rawContent() { self::parseRequest(); diff --git a/src/Module/Update/Network.php b/src/Module/Update/Network.php index c6e5225d6..a1a120ea2 100644 --- a/src/Module/Update/Network.php +++ b/src/Module/Update/Network.php @@ -9,7 +9,7 @@ use Friendica\Module\Conversation\Network as NetworkModule; class Network extends NetworkModule { - public static function rawContent() + public function rawContent() { if (!isset($_GET['p']) || !isset($_GET['item'])) { exit(); diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php index 2e9f676f8..b06aea804 100644 --- a/src/Module/Update/Profile.php +++ b/src/Module/Update/Profile.php @@ -35,7 +35,7 @@ use Friendica\Util\DateTimeFormat; class Profile extends BaseModule { - public static function rawContent() + public function rawContent() { $a = DI::app(); diff --git a/src/Module/Welcome.php b/src/Module/Welcome.php index c14df0160..92845cdaf 100644 --- a/src/Module/Welcome.php +++ b/src/Module/Welcome.php @@ -30,7 +30,7 @@ use Friendica\DI; */ class Welcome extends BaseModule { - public static function content() + public function content(): string { $config = DI::config(); diff --git a/src/Module/WellKnown/HostMeta.php b/src/Module/WellKnown/HostMeta.php index 14a3a17fe..a65b4db1a 100644 --- a/src/Module/WellKnown/HostMeta.php +++ b/src/Module/WellKnown/HostMeta.php @@ -33,7 +33,7 @@ use Friendica\Util\Crypto; */ class HostMeta extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/WellKnown/NodeInfo.php b/src/Module/WellKnown/NodeInfo.php index f1d8164cb..a41979280 100644 --- a/src/Module/WellKnown/NodeInfo.php +++ b/src/Module/WellKnown/NodeInfo.php @@ -30,7 +30,7 @@ use Friendica\DI; */ class NodeInfo extends BaseModule { - public static function rawContent() + public function rawContent() { self::printWellKnown(); } diff --git a/src/Module/WellKnown/SecurityTxt.php b/src/Module/WellKnown/SecurityTxt.php index 317db50fe..73a627c2e 100644 --- a/src/Module/WellKnown/SecurityTxt.php +++ b/src/Module/WellKnown/SecurityTxt.php @@ -29,7 +29,7 @@ use Friendica\BaseModule; */ class SecurityTxt extends BaseModule { - public static function rawContent() + public function rawContent() { $name = 'security.txt'; $fp = fopen($name, 'rt'); diff --git a/src/Module/WellKnown/XSocialRelay.php b/src/Module/WellKnown/XSocialRelay.php index a66feac03..c40182523 100644 --- a/src/Module/WellKnown/XSocialRelay.php +++ b/src/Module/WellKnown/XSocialRelay.php @@ -32,7 +32,7 @@ use Friendica\Protocol\Relay; */ class XSocialRelay extends BaseModule { - public static function rawContent() + public function rawContent() { $config = DI::config(); diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 459059a55..4a8e32e8e 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -36,7 +36,7 @@ use Friendica\Protocol\Salmon; */ class Xrd extends BaseModule { - public static function rawContent() + public function rawContent() { // @TODO: Replace with parameter from router if (DI::args()->getArgv()[0] == 'xrd') { diff --git a/tests/src/App/ModuleTest.php b/tests/src/App/ModuleTest.php index 7f5d65fcf..65e0873c1 100644 --- a/tests/src/App/ModuleTest.php +++ b/tests/src/App/ModuleTest.php @@ -197,7 +197,7 @@ class ModuleTest extends DatabaseTest $module = (new App\Module($name))->determineClass(new App\Arguments('', $command), $router, $config, $dice); - self::assertEquals($assert, $module->getClass()::getClassName()); + self::assertEquals($assert, $module->getClass()->getClassName()); } /**