]> git.mxchange.org Git - friendica.git/commitdiff
Replace `$parameters` argument per method with `static::$parameters`
authorPhilipp <admin@philipp.info>
Sun, 14 Nov 2021 19:46:25 +0000 (20:46 +0100)
committerPhilipp <admin@philipp.info>
Sun, 14 Nov 2021 22:49:05 +0000 (23:49 +0100)
249 files changed:
src/App/Module.php
src/App/Page.php
src/BaseModule.php
src/Capabilities/ICanHandleRequests.php
src/LegacyModule.php
src/Module/AccountManagementControlDocument.php
src/Module/Acctlink.php
src/Module/ActivityPub/Followers.php
src/Module/ActivityPub/Following.php
src/Module/ActivityPub/Inbox.php
src/Module/ActivityPub/Objects.php
src/Module/ActivityPub/Outbox.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Blocklist/Contact.php
src/Module/Admin/Blocklist/Server/Add.php
src/Module/Admin/Blocklist/Server/Index.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Federation.php
src/Module/Admin/Item/Delete.php
src/Module/Admin/Item/Source.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Logs/View.php
src/Module/Admin/PhpInfo.php
src/Module/Admin/Queue.php
src/Module/Admin/Site.php
src/Module/Admin/Storage.php
src/Module/Admin/Summary.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Admin/Tos.php
src/Module/Admin/Users/Active.php
src/Module/Admin/Users/Blocked.php
src/Module/Admin/Users/Create.php
src/Module/Admin/Users/Deleted.php
src/Module/Admin/Users/Index.php
src/Module/Admin/Users/Pending.php
src/Module/Api/Friendica/Activity.php
src/Module/Api/Friendica/DirectMessages/Setseen.php
src/Module/Api/Friendica/Events/Index.php
src/Module/Api/Friendica/Index.php
src/Module/Api/Friendica/Notification.php
src/Module/Api/Friendica/Photo/Delete.php
src/Module/Api/Friendica/Photoalbum/Delete.php
src/Module/Api/Friendica/Photoalbum/Update.php
src/Module/Api/Friendica/Profile/Show.php
src/Module/Api/GNUSocial/GNUSocial/Version.php
src/Module/Api/GNUSocial/Help/Test.php
src/Module/Api/Mastodon/Accounts.php
src/Module/Api/Mastodon/Accounts/Block.php
src/Module/Api/Mastodon/Accounts/FeaturedTags.php
src/Module/Api/Mastodon/Accounts/Follow.php
src/Module/Api/Mastodon/Accounts/Followers.php
src/Module/Api/Mastodon/Accounts/Following.php
src/Module/Api/Mastodon/Accounts/IdentityProofs.php
src/Module/Api/Mastodon/Accounts/Lists.php
src/Module/Api/Mastodon/Accounts/Mute.php
src/Module/Api/Mastodon/Accounts/Note.php
src/Module/Api/Mastodon/Accounts/Relationships.php
src/Module/Api/Mastodon/Accounts/Search.php
src/Module/Api/Mastodon/Accounts/Statuses.php
src/Module/Api/Mastodon/Accounts/Unblock.php
src/Module/Api/Mastodon/Accounts/Unfollow.php
src/Module/Api/Mastodon/Accounts/Unmute.php
src/Module/Api/Mastodon/Accounts/UpdateCredentials.php
src/Module/Api/Mastodon/Accounts/VerifyCredentials.php
src/Module/Api/Mastodon/Announcements.php
src/Module/Api/Mastodon/Apps.php
src/Module/Api/Mastodon/Apps/VerifyCredentials.php
src/Module/Api/Mastodon/Blocks.php
src/Module/Api/Mastodon/Bookmarks.php
src/Module/Api/Mastodon/Conversations.php
src/Module/Api/Mastodon/Conversations/Read.php
src/Module/Api/Mastodon/CustomEmojis.php
src/Module/Api/Mastodon/Directory.php
src/Module/Api/Mastodon/Endorsements.php
src/Module/Api/Mastodon/Favourited.php
src/Module/Api/Mastodon/Filters.php
src/Module/Api/Mastodon/FollowRequests.php
src/Module/Api/Mastodon/Instance.php
src/Module/Api/Mastodon/Instance/Peers.php
src/Module/Api/Mastodon/Instance/Rules.php
src/Module/Api/Mastodon/Lists.php
src/Module/Api/Mastodon/Lists/Accounts.php
src/Module/Api/Mastodon/Markers.php
src/Module/Api/Mastodon/Media.php
src/Module/Api/Mastodon/Mutes.php
src/Module/Api/Mastodon/Notifications.php
src/Module/Api/Mastodon/Notifications/Clear.php
src/Module/Api/Mastodon/Notifications/Dismiss.php
src/Module/Api/Mastodon/Preferences.php
src/Module/Api/Mastodon/Proofs.php
src/Module/Api/Mastodon/PushSubscription.php
src/Module/Api/Mastodon/ScheduledStatuses.php
src/Module/Api/Mastodon/Search.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Api/Mastodon/Statuses/Bookmark.php
src/Module/Api/Mastodon/Statuses/Card.php
src/Module/Api/Mastodon/Statuses/Context.php
src/Module/Api/Mastodon/Statuses/Favourite.php
src/Module/Api/Mastodon/Statuses/FavouritedBy.php
src/Module/Api/Mastodon/Statuses/Mute.php
src/Module/Api/Mastodon/Statuses/Pin.php
src/Module/Api/Mastodon/Statuses/Reblog.php
src/Module/Api/Mastodon/Statuses/RebloggedBy.php
src/Module/Api/Mastodon/Statuses/Unbookmark.php
src/Module/Api/Mastodon/Statuses/Unfavourite.php
src/Module/Api/Mastodon/Statuses/Unmute.php
src/Module/Api/Mastodon/Statuses/Unpin.php
src/Module/Api/Mastodon/Statuses/Unreblog.php
src/Module/Api/Mastodon/Suggestions.php
src/Module/Api/Mastodon/Timelines/Direct.php
src/Module/Api/Mastodon/Timelines/Home.php
src/Module/Api/Mastodon/Timelines/ListTimeline.php
src/Module/Api/Mastodon/Timelines/PublicTimeline.php
src/Module/Api/Mastodon/Timelines/Tag.php
src/Module/Api/Mastodon/Trends.php
src/Module/Api/Mastodon/Unimplemented.php
src/Module/Api/Twitter/Account/RateLimitStatus.php
src/Module/Api/Twitter/ContactEndpoint.php
src/Module/Api/Twitter/FollowersIds.php
src/Module/Api/Twitter/FollowersList.php
src/Module/Api/Twitter/FriendsIds.php
src/Module/Api/Twitter/FriendsList.php
src/Module/Api/Twitter/SavedSearches.php
src/Module/Apps.php
src/Module/Attach.php
src/Module/BaseAdmin.php
src/Module/BaseApi.php
src/Module/BaseNotifications.php
src/Module/BaseSettings.php
src/Module/Bookmarklet.php
src/Module/Contact.php
src/Module/Contact/Advanced.php
src/Module/Contact/Contacts.php
src/Module/Contact/Hovercard.php
src/Module/Contact/Media.php
src/Module/Contact/Poke.php
src/Module/Contact/Revoke.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/Credits.php
src/Module/DFRN/Notify.php
src/Module/DFRN/Poll.php
src/Module/Debug/ActivityPubConversion.php
src/Module/Debug/Babel.php
src/Module/Debug/Feed.php
src/Module/Debug/ItemBody.php
src/Module/Debug/Localtime.php
src/Module/Debug/Probe.php
src/Module/Debug/WebFinger.php
src/Module/Delegation.php
src/Module/Diaspora/Fetch.php
src/Module/Diaspora/Receive.php
src/Module/Directory.php
src/Module/Events/Json.php
src/Module/Feed.php
src/Module/Filer/RemoveTag.php
src/Module/Filer/SaveTag.php
src/Module/FollowConfirm.php
src/Module/FriendSuggest.php
src/Module/Friendica.php
src/Module/Group.php
src/Module/HCard.php
src/Module/HTTPException/MethodNotAllowed.php
src/Module/HTTPException/PageNotFound.php
src/Module/Hashtag.php
src/Module/Help.php
src/Module/Home.php
src/Module/Install.php
src/Module/Invite.php
src/Module/Item/Activity.php
src/Module/Item/Compose.php
src/Module/Item/Follow.php
src/Module/Item/Ignore.php
src/Module/Item/Pin.php
src/Module/Item/Star.php
src/Module/Magic.php
src/Module/Maintenance.php
src/Module/Manifest.php
src/Module/NoScrape.php
src/Module/NodeInfo110.php
src/Module/NodeInfo120.php
src/Module/NodeInfo210.php
src/Module/Notifications/Introductions.php
src/Module/Notifications/Notification.php
src/Module/Notifications/Notifications.php
src/Module/OAuth/Acknowledge.php
src/Module/OAuth/Authorize.php
src/Module/OAuth/Revoke.php
src/Module/OAuth/Token.php
src/Module/Oembed.php
src/Module/OpenSearch.php
src/Module/Owa.php
src/Module/ParseUrl.php
src/Module/PermissionTooltip.php
src/Module/Photo.php
src/Module/Profile/Common.php
src/Module/Profile/Contacts.php
src/Module/Profile/Index.php
src/Module/Profile/Media.php
src/Module/Profile/Profile.php
src/Module/Profile/Schedule.php
src/Module/Profile/Status.php
src/Module/Proxy.php
src/Module/PublicRSAKey.php
src/Module/RandomProfile.php
src/Module/ReallySimpleDiscovery.php
src/Module/Register.php
src/Module/RemoteFollow.php
src/Module/RobotsTxt.php
src/Module/Search/Acl.php
src/Module/Search/Directory.php
src/Module/Search/Filed.php
src/Module/Search/Index.php
src/Module/Search/Saved.php
src/Module/Security/Login.php
src/Module/Security/Logout.php
src/Module/Security/OpenID.php
src/Module/Security/TwoFactor/Recovery.php
src/Module/Security/TwoFactor/Verify.php
src/Module/Settings/Delegation.php
src/Module/Settings/Display.php
src/Module/Settings/Profile/Index.php
src/Module/Settings/Profile/Photo/Crop.php
src/Module/Settings/Profile/Photo/Index.php
src/Module/Settings/TwoFactor/AppSpecific.php
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Trusted.php
src/Module/Settings/TwoFactor/Verify.php
src/Module/Settings/UserExport.php
src/Module/Smilies.php
src/Module/Statistics.php
src/Module/Theme.php
src/Module/ThemeDetails.php
src/Module/ToggleMobile.php
src/Module/Tos.php
src/Module/Update/Community.php
src/Module/Update/Network.php
src/Module/Update/Profile.php
src/Module/Welcome.php
src/Module/WellKnown/HostMeta.php
src/Module/WellKnown/NodeInfo.php
src/Module/WellKnown/SecurityTxt.php
src/Module/WellKnown/XSocialRelay.php
src/Module/Xrd.php

index 98d2d620d29cb60af20836da8c2f1c8c0d2dd1b8..0f0cfa6562fd044a5a904fd630e79f7f5da79f38 100644 (file)
@@ -297,32 +297,32 @@ class Module
 
                Core\Hook::callAll($this->module . '_mod_init', $placeholder);
 
-               $this->module_class::init($this->module_class::getParameters());
+               $this->module_class::init();
 
                $profiler->set(microtime(true) - $timestamp, 'init');
 
                if ($server['REQUEST_METHOD'] === Router::DELETE) {
-                       $this->module_class::delete($this->module_class::getParameters());
+                       $this->module_class::delete();
                }
 
                if ($server['REQUEST_METHOD'] === Router::PATCH) {
-                       $this->module_class::patch($this->module_class::getParameters());
+                       $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::getParameters());
+                       $this->module_class::post();
                }
 
                if ($server['REQUEST_METHOD'] === Router::PUT) {
-                       $this->module_class::put($this->module_class::getParameters());
+                       $this->module_class::put();
                }
 
                Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
-               $this->module_class::afterpost($this->module_class::getParameters());
+               $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::getParameters());
+               $this->module_class::rawContent();
        }
 }
index c20f26cefbb9f1741691dfc5621373aa6caf6926..c29517b1c7ac0eea50add64290b6792d382801ce 100644 (file)
@@ -352,7 +352,7 @@ class Page implements ArrayAccess
                        $arr = ['content' => $content];
                        Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr);
                        $content = $arr['content'];
-                       $arr     = ['content' => $moduleClass::content($moduleClass::getParameters())];
+                       $arr     = ['content' => $moduleClass::content()];
                        Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr);
                        $content .= $arr['content'];
                } catch (HTTPException $e) {
index 90ba9e13290fe93b0b2ab080ad8ef9dadf51547e..b9db1953e5a3c6ef1c0550969383c4fb7245b73c 100644 (file)
@@ -44,25 +44,17 @@ abstract class BaseModule implements ICanHandleRequests
                static::$parameters = $parameters;
        }
 
-       /**
-        * @return array
-        */
-       public static function getParameters(): array
-       {
-               return self::$parameters;
-       }
-
        /**
         * {@inheritDoc}
         */
-       public static function init(array $parameters = [])
+       public static function init()
        {
        }
 
        /**
         * {@inheritDoc}
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // echo '';
                // exit;
@@ -71,7 +63,7 @@ abstract class BaseModule implements ICanHandleRequests
        /**
         * {@inheritDoc}
         */
-       public static function content(array $parameters = [])
+       public static function content()
        {
                return '';
        }
@@ -79,21 +71,21 @@ abstract class BaseModule implements ICanHandleRequests
        /**
         * {@inheritDoc}
         */
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
        }
 
        /**
         * {@inheritDoc}
         */
-       public static function patch(array $parameters = [])
+       public static function patch()
        {
        }
 
        /**
         * {@inheritDoc}
         */
-       public static function post(array $parameters = [])
+       public static function post()
        {
                // DI::baseurl()->redirect('module');
        }
@@ -101,14 +93,14 @@ abstract class BaseModule implements ICanHandleRequests
        /**
         * {@inheritDoc}
         */
-       public static function afterpost(array $parameters = [])
+       public static function afterpost()
        {
        }
 
        /**
         * {@inheritDoc}
         */
-       public static function put(array $parameters = [])
+       public static function put()
        {
        }
 
index 0e1582bf64080e582fffaae52311a5492c05b5ce..1d44208775ceedbab405b0aab667474b349e7e56 100644 (file)
@@ -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(array $parameters = []);
+       public static 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(array $parameters = []);
+       public static function rawContent();
 
        /**
         * Module GET method to display any content
@@ -32,7 +32,7 @@ interface ICanHandleRequests
         *
         * @return string
         */
-       public static function content(array $parameters = []);
+       public static function content();
 
        /**
         * Module DELETE method to process submitted data
@@ -40,7 +40,7 @@ interface ICanHandleRequests
         * Extend this method if the module is supposed to process DELETE requests.
         * Doesn't display any content
         */
-       public static function delete(array $parameters = []);
+       public static function delete();
 
        /**
         * Module PATCH method to process submitted data
@@ -48,7 +48,7 @@ interface ICanHandleRequests
         * Extend this method if the module is supposed to process PATCH requests.
         * Doesn't display any content
         */
-       public static function patch(array $parameters = []);
+       public static function patch();
 
        /**
         * Module POST method to process submitted data
@@ -56,14 +56,14 @@ interface ICanHandleRequests
         * Extend this method if the module is supposed to process POST requests.
         * Doesn't display any content
         */
-       public static function post(array $parameters = []);
+       public static function post();
 
        /**
         * Called after post()
         *
         * Unknown purpose
         */
-       public static function afterpost(array $parameters = []);
+       public static function afterpost();
 
        /**
         * Module PUT method to process submitted data
@@ -71,9 +71,7 @@ interface ICanHandleRequests
         * Extend this method if the module is supposed to process PUT requests.
         * Doesn't display any content
         */
-       public static function put(array $parameters = []);
+       public static function put();
 
        public static function getClassName(): string;
-
-       public static function getParameters(): array;
 }
index 224b94debec19d9cc0127b406dd599c00238184c..ac4d5cd2c031888ba23b2bb2847e74c15deaf4b9 100644 (file)
@@ -54,24 +54,24 @@ class LegacyModule extends BaseModule
                require_once $file_path;
        }
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
-               self::runModuleFunction('init', $parameters);
+               self::runModuleFunction('init', static::$parameters);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               return self::runModuleFunction('content', $parameters);
+               return self::runModuleFunction('content', static::$parameters);
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
-               self::runModuleFunction('post', $parameters);
+               self::runModuleFunction('post', static::$parameters);
        }
 
-       public static function afterpost(array $parameters = [])
+       public static function afterpost()
        {
-               self::runModuleFunction('afterpost', $parameters);
+               self::runModuleFunction('afterpost', static::$parameters);
        }
 
        /**
index ddd22dc3df18d8c9cf467020eb6eec38be162b6a..8c87343d553aa73636dcb14efc56747781e0801a 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\BaseModule;
  */
 class AccountManagementControlDocument extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $output = [
                        'version' => 1,
index 898386f3fd6f9a0b92fe86bf19873ff426410581..f8184c82f1bc558f59590eb7c4ae9eeaa9a87b97 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Model\Contact;
  */
 class Acctlink extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $addr = trim($_GET['addr'] ?? '');
 
index e1f1ccc4c1c452ec38ff40618a9ee46297d6d799..8c90b2ac06c4f320dd993bb714bcf8093f53271a 100644 (file)
@@ -31,14 +31,14 @@ use Friendica\Protocol\ActivityPub;
  */
 class Followers extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['nickname'])) {
+               if (empty(static::$parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
                // @TODO: Replace with parameter from router
-               $owner = User::getOwnerDataByNick($parameters['nickname']);
+               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index e9cb10be1f49455545ff8f75f317d9fb924e21fa..08574b546f73c50fe3a253791392beea741d698e 100644 (file)
@@ -31,13 +31,13 @@ use Friendica\Protocol\ActivityPub;
  */
 class Following extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['nickname'])) {
+               if (empty(static::$parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $owner = User::getOwnerDataByNick($parameters['nickname']);
+               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index 2ef12a83d811da054220cbe7fd662b047a252835..3e0ca1856229606f66e3496fe7f4c3cbc27fd9bd 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Network;
  */
 class Inbox extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $postdata = Network::postdata();
 
@@ -50,12 +50,12 @@ class Inbox extends BaseModule
                                $filename = 'failed-activitypub';
                        }
                        $tempfile = tempnam(System::getTempPath(), $filename);
-                       file_put_contents($tempfile, json_encode(['parameters' => $parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
+                       file_put_contents($tempfile, json_encode(['parameters' => static::$parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
                        Logger::notice('Incoming message stored', ['file' => $tempfile]);
                }
 
-               if (!empty($parameters['nickname'])) {
-                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => $parameters['nickname']]);
+               if (!empty(static::$parameters['nickname'])) {
+                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
                        if (!DBA::isResult($user)) {
                                throw new \Friendica\Network\HTTPException\NotFoundException();
                        }
index 232c80e5bd389abfe808f805be4af6ce3c7bf09c..826bfd10cf87be7af657068c2d494f2e49bcda45 100644 (file)
@@ -41,9 +41,9 @@ use Friendica\Util\Strings;
  */
 class Objects extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['guid'])) {
+               if (empty(static::$parameters['guid'])) {
                        throw new HTTPException\BadRequestException();
                }
 
@@ -51,10 +51,10 @@ class Objects extends BaseModule
                        DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
                }
 
-               $itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => $parameters['guid']]);
+               $itemuri = DBA::selectFirst('item-uri', ['id'], ['guid' => static::$parameters['guid']]);
 
                if (DBA::isResult($itemuri)) {
-                       Logger::info('Provided GUID found.', ['guid' => $parameters['guid'], 'uri-id' => $itemuri['id']]);
+                       Logger::info('Provided GUID found.', ['guid' => static::$parameters['guid'], 'uri-id' => $itemuri['id']]);
                } else {
                        // The item URI does not always contain the GUID. This means that we have to search the URL instead
                        $url = DI::baseUrl()->get() . '/' . DI::args()->getQueryString();
@@ -104,11 +104,11 @@ class Objects extends BaseModule
                        throw new HTTPException\NotFoundException();
                }
 
-               $etag          = md5($parameters['guid'] . '-' . $item['changed']);
+               $etag          = md5(static::$parameters['guid'] . '-' . $item['changed']);
                $last_modified = $item['changed'];
                Network::checkEtagModified($etag, $last_modified);
 
-               if (empty($parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
+               if (empty(static::$parameters['activity']) && ($item['gravity'] != GRAVITY_ACTIVITY)) {
                        $activity = ActivityPub\Transmitter::createActivityFromItem($item['id'], true);
                        if (empty($activity['type'])) {
                                throw new HTTPException\NotFoundException();
@@ -123,16 +123,16 @@ class Objects extends BaseModule
 
                        $data = ['@context' => ActivityPub::CONTEXT];
                        $data = array_merge($data, $activity['object']);
-               } elseif (empty($parameters['activity']) || in_array($parameters['activity'],
+               } elseif (empty(static::$parameters['activity']) || in_array(static::$parameters['activity'],
                        ['Create', 'Announce', 'Update', 'Like', 'Dislike', 'Accept', 'Reject',
                        'TentativeAccept', 'Follow', 'Add'])) {
                        $data = ActivityPub\Transmitter::createActivityFromItem($item['id']);
                        if (empty($data)) {
                                throw new HTTPException\NotFoundException();
                        }
-                       if (!empty($parameters['activity']) && ($parameters['activity'] != 'Create')) {
-                               $data['type'] = $parameters['activity'];
-                               $data['id'] = str_replace('/Create', '/' . $parameters['activity'], $data['id']);
+                       if (!empty(static::$parameters['activity']) && (static::$parameters['activity'] != 'Create')) {
+                               $data['type'] = static::$parameters['activity'];
+                               $data['id'] = str_replace('/Create', '/' . static::$parameters['activity'], $data['id']);
                        }
                } else {
                        throw new HTTPException\NotFoundException();
index fe838960d581766b8a9db6518160c537e940d42b..a2ae10839d42548cbf5ea2004a8b85e3e61fe30e 100644 (file)
@@ -31,13 +31,13 @@ use Friendica\Util\HTTPSignature;
  */
 class Outbox extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['nickname'])) {
+               if (empty(static::$parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $owner = User::getOwnerDataByNick($parameters['nickname']);
+               $owner = User::getOwnerDataByNick(static::$parameters['nickname']);
                if (empty($owner)) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
index 79660dee38b9ecb6ded25a1b9969c28d12ce9a7c..dbb2a67a07baf7e4b1439a2d9ee28c469e105186 100644 (file)
@@ -30,11 +30,11 @@ use Friendica\Util\Strings;
 
 class Details extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
-               $addon = Strings::sanitizeFilePathItem($parameters['addon']);
+               $addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
 
                $redirect = 'admin/addons/' . $addon;
 
@@ -52,15 +52,15 @@ class Details extends BaseAdmin
                DI::baseUrl()->redirect($redirect);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $a = DI::app();
 
                $addons_admin = Addon::getAdminList();
 
-               $addon = Strings::sanitizeFilePathItem($parameters['addon']);
+               $addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
                if (!is_file("addon/$addon/$addon.php")) {
                        notice(DI::l10n()->t('Addon not found.'));
                        Addon::uninstall($addon);
index 56d570b28e8acee8d1989d2b977e3ab7e1008935..e018b7c70f6ee411f3e0ae1df19df2394e0657c2 100644 (file)
@@ -28,9 +28,9 @@ use Friendica\Module\BaseAdmin;
 
 class Index extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                // reload active themes
                if (!empty($_GET['action'])) {
index bd30e2f8ddbef14e42a3f03c280bdc917b5c826a..33041ee9bbd7be4a03f05e2eec3466d1d91f08ba 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Util\Network;
 
 class Contact extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -76,9 +76,9 @@ class Contact extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/contact');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $condition = ['uid' => 0, 'blocked' => true];
 
index 03f10264016ed443717fbe4ff702d08ef9e2f5f7..56b7400f1526415a4fce1ead98d4b2f98b339ede 100644 (file)
@@ -32,7 +32,7 @@ use GuzzleHttp\Psr7\Uri;
 
 class Add extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -66,9 +66,9 @@ class Add extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/server');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $gservers = [];
 
index 7dd59678a433bbc3a5f32ff23af64758067e9ede..e819c9366fa863ebdfba0083ab0d62f5a445b11e 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
 
 class Index extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -56,9 +56,9 @@ class Index extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/server');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $blocklist     = DI::config()->get('system', 'blocklist');
                $blocklistform = [];
index 9449e3be70ab95ab203ea0a114f2068c86e962cf..ef9df4491145a7867e1770a0228ed0036038e628 100644 (file)
@@ -30,14 +30,14 @@ use Friendica\Module\BaseAdmin;
 
 class DBSync extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $a = DI::app();
 
-               $action = $parameters['action'] ?? '';
-               $update = $parameters['update'] ?? 0;
+               $action = static::$parameters['action'] ?? '';
+               $update = static::$parameters['update'] ?? 0;
 
                switch ($action) {
                        case 'mark':
index d3af3ebc0289189a97a9793a40d08e7321475673..76bb35f53aa535fa53f8c96375ae3d3b90f68a91 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
 
 class Features extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -60,9 +60,9 @@ class Features extends BaseAdmin
                DI::baseUrl()->redirect('admin/features');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $features = [];
 
index 4be23197597fa4816e3453ed06c87e5fa6dddef7..9d0070e2d771504f160ae7d348128c3c9f5985fa 100644 (file)
@@ -28,9 +28,9 @@ use Friendica\Module\BaseAdmin;
 
 class Federation extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                // get counts on active federation systems this node is knowing
                // We list the more common systems by name. The rest is counted as "other"
index 7afc3b09038e2c888d6d218fc183a6467a9993d1..9380b02e0b0067ba895728e4e02945e4aeb0eb9d 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Util\Strings;
 
 class Delete extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -55,9 +55,9 @@ class Delete extends BaseAdmin
                DI::baseUrl()->redirect('admin/item/delete');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $t = Renderer::getMarkupTemplate('admin/item/delete.tpl');
 
index 61e598a68fc6ddea8f0521d1a57401d83f6b43a9..a6dac1a1a16716586f46fbdcfc695dcc2108de7f 100644 (file)
@@ -29,11 +29,11 @@ use Friendica\Module\BaseAdmin;
 class Source extends BaseAdmin
 
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $guid = basename($_REQUEST['guid'] ?? $parameters['guid'] ?? '');
+               $guid = basename($_REQUEST['guid'] ?? static::$parameters['guid'] ?? '');
 
                $source = '';
                $item_uri = '';
index b0fcaebc33117d00e07a34870cd7681e6dff4233..faf74266387ce7c2b903a21fd72950efe65403b9 100644 (file)
@@ -29,7 +29,7 @@ use Psr\Log\LogLevel;
 
 class Settings extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -56,9 +56,9 @@ class Settings extends BaseAdmin
                DI::baseUrl()->redirect('admin/logs');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $log_choices = [
                        LogLevel::ERROR   => 'Error',
index e0e12760bc670402548129e6e706bddf68dfec00..d1d44c00f567dbbb4703170317d2724f7ec0c153 100644 (file)
@@ -31,9 +31,9 @@ class View extends BaseAdmin
 {
        const LIMIT = 500;
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $t = Renderer::getMarkupTemplate('admin/logs/view.tpl');
                DI::page()->registerFooterScript(Theme::getPathForFile('js/module/admin/logs/view.js'));
@@ -75,7 +75,7 @@ class View extends BaseAdmin
                                                ->withLimit(self::LIMIT)
                                                ->withFilters($filters)
                                                ->withSearch($search);
-                       } catch (Exception $e) {
+                       } catch (\Exception $e) {
                                $error = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.<br/>Check to see if file %1$s is readable.', $f);
                        }
                }
index 74cbc3d90106b23fe1de2e50faf04e92f28c4090..8bf15cb0e4807464f63b435c29e48c6685a42f34 100644 (file)
@@ -25,7 +25,7 @@ use Friendica\Module\BaseAdmin;
 
 class PhpInfo extends BaseAdmin
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAdminAccess();
 
index f0883b361f28592bf3167a189d8a6fa1cca24fb4..69c16c39d2dfcd53ba2d7246a16f91e241bf2334 100644 (file)
@@ -38,11 +38,11 @@ use Friendica\Util\DateTimeFormat;
  */
 class Queue extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $status = $parameters['status'] ?? '';
+               $status = static::$parameters['status'] ?? '';
 
                // get jobs from the workerqueue table
                if ($status == 'deferred') {
index 0edc713ae6347990f23243613e3b0dae2133b5d8..e8d463f809922d5a5ee0e26b571af0a4b51817f0 100644 (file)
@@ -43,7 +43,7 @@ require_once __DIR__ . '/../../../boot.php';
 
 class Site extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -384,9 +384,9 @@ class Site extends BaseAdmin
                DI::baseUrl()->redirect('admin/site' . $active_panel);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                /* Installed langs */
                $lang_choices = DI::l10n()->getAvailableLanguages();
index 51e70d841ebc73eba194a95627ea649e7e499ff4..1f598c1a23f8101e69697e06a83196d785ef9231 100644 (file)
@@ -31,13 +31,13 @@ use Friendica\Util\Strings;
 
 class Storage extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
                self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
 
-               $storagebackend = trim($parameters['name'] ?? '');
+               $storagebackend = trim(static::$parameters['name'] ?? '');
 
                try {
                        /** @var ICanConfigureStorage|false $newStorageConfig */
@@ -91,9 +91,9 @@ class Storage extends BaseAdmin
                DI::baseUrl()->redirect('admin/storage');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $current_storage_backend = DI::storage();
                $available_storage_forms = [];
index ca244260f63998621f776675d9323792da929088..1eeba4883d7176164664119a6d7778f51cabe7bf 100644 (file)
@@ -37,9 +37,9 @@ use Friendica\Util\DateTimeFormat;
 
 class Summary extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $a = DI::app();
 
index b8ecfe1ce645c59cede2a533c52b2e7b515d6274..bd02572684b325047184cc10540fc8ecf3ff3540 100644 (file)
@@ -30,11 +30,11 @@ use Friendica\Util\Strings;
 
 class Details extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $theme = Strings::sanitizeFilePathItem($parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
                        notice(DI::l10n()->t("Item not found."));
                        return '';
index dabc9209e6be695ea27bcb04636babcc9265b481..59855b13b25016e3762f8f7f9a217fb3ed4f6f7f 100644 (file)
@@ -28,19 +28,19 @@ use Friendica\Util\Strings;
 
 class Embed extends BaseAdmin
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
-               $theme = Strings::sanitizeFilePathItem($parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
                if (is_file("view/theme/$theme/config.php")) {
                        DI::app()->setCurrentTheme($theme);
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
-               $theme = Strings::sanitizeFilePathItem($parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
                if (is_file("view/theme/$theme/config.php")) {
                        require_once "view/theme/$theme/config.php";
                        if (function_exists('theme_admin_post')) {
@@ -56,11 +56,11 @@ class Embed extends BaseAdmin
                DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $theme = Strings::sanitizeFilePathItem($parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
                if (!is_dir("view/theme/$theme")) {
                        notice(DI::l10n()->t('Unknown theme.'));
                        return '';
index d9cb326b441df210b4cd203ec8fc87a3f0d7e76c..7bd09695ece0284d71d3a10003207fc0dd3673bf 100644 (file)
@@ -29,9 +29,9 @@ use Friendica\Util\Strings;
 
 class Index extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $allowed_themes = Theme::getAllowedList();
 
index 282e5daf1deb8a0e272b2c35cb1dfa290eb3f679..a31b403f97a8f33e2a7bbde13ca89a7201288085 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
 
 class Tos extends BaseAdmin
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -48,11 +48,11 @@ class Tos extends BaseAdmin
                DI::baseUrl()->redirect('admin/tos');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $tos = new \Friendica\Module\Tos();
+               $tos = new \Friendica\Module\Tos(static::$parameters);
                $t = Renderer::getMarkupTemplate('admin/tos.tpl');
                return Renderer::replaceMacros($t, [
                        '$title' => DI::l10n()->t('Administration'),
index 7eac47d116a1be95780ad9441db77f87b0f40b16..4882ac4eb5a42b37ae3592124bf70b17849fb8fc 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Active extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -60,12 +60,12 @@ class Active extends BaseUsers
                DI::baseUrl()->redirect(DI::args()->getQueryString());
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $action = $parameters['action'] ?? '';
-               $uid = $parameters['uid'] ?? 0;
+               $action = static::$parameters['action'] ?? '';
+               $uid = static::$parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 35e7c25bfaf9ac57d5e1b2b788012a4bde3a27a8..6b80081655a3c98110e0c91b1daf84e399e018d6 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\Temporal;
 
 class Blocked extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -61,12 +61,12 @@ class Blocked extends BaseUsers
                DI::baseUrl()->redirect('admin/users/blocked');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $action = $parameters['action'] ?? '';
-               $uid = $parameters['uid'] ?? 0;
+               $action = static::$parameters['action'] ?? '';
+               $uid = static::$parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 078547f46914a0563ba4d70dff4db29ed9edc3ae..b80866603078bc989c649fcdba592c185eef28fb 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Create extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -51,9 +51,9 @@ class Create extends BaseUsers
                DI::baseUrl()->redirect('admin/users/create');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $t = Renderer::getMarkupTemplate('admin/users/create.tpl');
                return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
index 2ebaec8b7f703b01ff7bd31654b905a962864d7d..8d71b4792ad36aeef55706fd5b902316fc5653d6 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
 
 class Deleted extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -44,9 +44,9 @@ class Deleted extends BaseUsers
                DI::baseUrl()->redirect('admin/users/deleted');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
 
index d391feb44774bd88c860f02b59d142203e6309d6..1137b2cf96c2b3410c31ed7fa67d776397240ea8 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Index extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -67,12 +67,12 @@ class Index extends BaseUsers
                DI::baseUrl()->redirect(DI::args()->getQueryString());
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $action = $parameters['action'] ?? '';
-               $uid = $parameters['uid'] ?? 0;
+               $action = static::$parameters['action'] ?? '';
+               $uid = static::$parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 14381682fde47b08be99d950aad76d8ccee09b34..ef7d7b12ef46af3cb943e3f6a3ad0a540d356458 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
 
 class Pending extends BaseUsers
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAdminAccess();
 
@@ -58,12 +58,12 @@ class Pending extends BaseUsers
                DI::baseUrl()->redirect('admin/users/pending');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
-               $action = $parameters['action'] ?? '';
-               $uid = $parameters['uid'] ?? 0;
+               $action = static::$parameters['action'] ?? '';
+               $uid = static::$parameters['uid'] ?? 0;
 
                if ($uid) {
                        $user = User::getById($uid, ['username', 'blocked']);
index 00228c0ccc90a5803ac5fcdbb95077260079124b..b80d0585bc567cc3776c2f20d740aa9486ced9f0 100644 (file)
@@ -40,7 +40,7 @@ use Friendica\Module\BaseApi;
  */
 class Activity extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -49,17 +49,17 @@ class Activity extends BaseApi
                        'id' => 0, // Id of the post
                ]);
 
-               $res = Item::performActivity($request['id'], $parameters['verb'], $uid);
+               $res = Item::performActivity($request['id'], static::$parameters['verb'], $uid);
 
                if ($res) {
-                       if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
+                       if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
                                $ok = 'true';
                        } else {
                                $ok = 'ok';
                        }
-                       DI::apiResponse()->exit('ok', ['ok' => $ok], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('ok', ['ok' => $ok], static::$parameters['extension'] ?? null);
                } else {
-                       DI::apiResponse()->error(500, 'Error adding activity', '', $parameters['extension'] ?? null);
+                       DI::apiResponse()->error(500, 'Error adding activity', '', static::$parameters['extension'] ?? null);
                }
        }
 }
index e55ad74b9650571551ad4562f7a5f23e03ac4b96..dfffe3bbf010ada7c27fda160f165fa83c6bfa65 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class Setseen extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -42,13 +42,13 @@ class Setseen extends BaseApi
                // return error if id is zero
                if (empty($request['id'])) {
                        $answer = ['result' => 'error', 'message' => 'message id not specified'];
-                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
                }
 
                // error message if specified id is not in database
                if (!DBA::exists('mail', ['id' => $request['id'], 'uid' => $uid])) {
                        $answer = ['result' => 'error', 'message' => 'message id not in database'];
-                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
                }
 
                // update seen indicator
@@ -58,6 +58,6 @@ class Setseen extends BaseApi
                        $answer = ['result' => 'error', 'message' => 'unknown error'];
                }
 
-               DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], static::$parameters['extension'] ?? null);
        }
 }
index 31c55069daac6b07ac4ddf0ca46b77ae5b7db093..8a610c9d189242ef63e22e222cbdd20307e1c73a 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Index extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -70,6 +70,6 @@ class Index extends BaseApi
                        ];
                }
 
-               DI::apiResponse()->exit('events', ['events' => $items], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('events', ['events' => $items], static::$parameters['extension'] ?? null);
        }
 }
index 8891d218a95139e8d0c181f1a7fda5b2e5815fe5..b028d8bb6f5bc8faa4f48afbe8c2adc763301f41 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Index extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);             
        }
 
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
        }
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                echo api_call(DI::app());
                exit();
index 2a50bde7b5f5bd2a5eeac3b8b751c55eb16f5ca4..6dc4f7831931d2fd9bf7f4f5aa4d90eec727af7b 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Object\Api\Friendica\Notification as ApiNotification;
  */
 class Notification extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -43,7 +43,7 @@ class Notification extends BaseApi
                        $notifications[] = new ApiNotification($Notify);
                }
 
-               if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
+               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
                        $xmlnotes = [];
                        foreach ($notifications as $notification) {
                                $xmlnotes[] = ['@attributes' => $notification->toArray()];
@@ -56,6 +56,6 @@ class Notification extends BaseApi
                        $result = false;
                }
 
-               DI::apiResponse()->exit('notes', ['note' => $result], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('notes', ['note' => $result], static::$parameters['extension'] ?? null);
        }
 }
index cf287d3d333376b02dc5656686d13cecc9fc4c40..4eb8e0dcc508233c1b7564a22cdbb18cbfa1ce3d 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Delete extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -64,7 +64,7 @@ class Delete extends BaseApi
                        Item::deleteForUser($condition, $uid);
 
                        $result = ['result' => 'deleted', 'message' => 'photo with id `' . $request['photo_id'] . '` has been deleted from server.'];
-                       DI::apiResponse()->exit('photo_delete', ['$result' => $result], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photo_delete', ['$result' => $result], static::$parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error on deleting photo from database table");
                }
index dd18365b4634ae3a3f6cebb9960fcd581daba9ac..f6dc85fcea662fb28425b40b567c3459188afa36 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Delete extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -67,7 +67,7 @@ class Delete extends BaseApi
                // return success of deletion or error message
                if ($result) {
                        $answer = ['result' => 'deleted', 'message' => 'album `' . $request['album'] . '` with all containing photos has been deleted.'];
-                       DI::apiResponse()->exit('photoalbum_delete', ['$result' => $answer], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photoalbum_delete', ['$result' => $answer], static::$parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error - deleting from database failed");
                }
index 369d33e825407be8809e943208536dbb8cc15e25..311396db375b422c9728f3f4a7aa411f304d4d60 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Update extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -59,7 +59,7 @@ class Update extends BaseApi
                // return success of updating or error message
                if ($result) {
                        $answer = ['result' => 'updated', 'message' => 'album `' . $request['album'] . '` with all containing photos has been renamed to `' . $request['album_new'] . '`.'];
-                       DI::apiResponse()->exit('photoalbum_update', ['$result' => $answer], $parameters['extension'] ?? null);
+                       DI::apiResponse()->exit('photoalbum_update', ['$result' => $answer], static::$parameters['extension'] ?? null);
                } else {
                        throw new InternalServerErrorException("unknown error - updating in database failed");
                }
index e388405effa042ec3c25d4486061bc20897f5dba..ae14c8d41a8d9ec66bf1d66d537a00fd6e2ef909 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class Show extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -49,7 +49,7 @@ class Show extends BaseApi
                $profile = self::formatProfile($profile, $profileFields);
 
                $profiles = [];
-               if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
+               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
                        $profiles['0:profile'] = $profile;
                } else {
                        $profiles[] = $profile;
@@ -65,7 +65,7 @@ class Show extends BaseApi
                        'profiles' => $profiles
                ];
 
-               DI::apiResponse()->exit('friendica_profiles', ['$result' => $result], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('friendica_profiles', ['$result' => $result], static::$parameters['extension'] ?? null);
        }
 
        /**
index 52393702f98f6f8042118f6f8bc4b368562d6672..34fc3c692742cb19bfef4217b707d69c832eaff8 100644 (file)
@@ -29,8 +29,8 @@ use Friendica\DI;
  */
 class Version extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               DI::apiResponse()->exit('version', ['version' => '0.9.7'], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('version', ['version' => '0.9.7'], static::$parameters['extension'] ?? null);
        }
 }
index 3df694c859e62c73d97ecf2a4aa67743dd062dad..6eedfc1ca9fb9f8cb69ec60f705535bdbd2a1896 100644 (file)
@@ -29,14 +29,14 @@ use Friendica\DI;
  */
 class Test extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
+               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
                        $ok = 'true';
                } else {
                        $ok = 'ok';
                }
 
-               DI::apiResponse()->exit('ok', ['ok' => $ok], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('ok', ['ok' => $ok], static::$parameters['extension'] ?? null);
        }
 }
index 781547854aada3932d0e753ad33726b608ba2e94..360993397ac0aaf9c96f490f99b0a0603fb0345b 100644 (file)
@@ -33,27 +33,26 @@ use Friendica\Module\BaseApi;
 class Accounts extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id']) && empty($parameters['name'])) {
+               if (empty(static::$parameters['id']) && empty(static::$parameters['name'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!empty($parameters['id'])) {
-                       $id = $parameters['id'];
+               if (!empty(static::$parameters['id'])) {
+                       $id = static::$parameters['id'];
                        if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                                DI::mstdnError()->RecordNotFound();
                        }
                } else {
-                       $contact = Contact::selectFirst(['id'], ['nick' => $parameters['name'], 'uid' => 0]);
+                       $contact = Contact::selectFirst(['id'], ['nick' => static::$parameters['name'], 'uid' => 0]);
                        if (!empty($contact['id'])) {
                                $id = $contact['id'];
-                       } elseif (!($id = Contact::getIdForURL($parameters['name'], 0, false))) {
+                       } elseif (!($id = Contact::getIdForURL(static::$parameters['name'], 0, false))) {
                                DI::mstdnError()->RecordNotFound();
                        }
                }
index 463383df71c4608032b7c0da5f8db785935b7359..c32862ca48790b0d2c4d85e17895c2d24ec31f13 100644 (file)
@@ -32,12 +32,12 @@ use Friendica\Module\BaseApi;
  */
 class Block extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -46,7 +46,7 @@ class Block extends BaseApi
                        DI::mstdnError()->Forbidden();
                }
 
-               $cdata = Contact::getPublicAndUserContactID($parameters['id'], $uid);
+               $cdata = Contact::getPublicAndUserContactID(static::$parameters['id'], $uid);
                if (empty($cdata['user'])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -62,6 +62,6 @@ class Block extends BaseApi
                Contact::terminateFriendship($owner, $contact);
                Contact::revokeFollow($contact);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index c4a4a561c68836061c985eca2beebd042b71dcf1..cbb409d1b44fa8d7f208c5b816cc953474667618 100644 (file)
@@ -30,10 +30,9 @@ use Friendica\Module\BaseApi;
 class FeaturedTags extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index ab7038e979af932927ffefcee91b69092172a891..b02ee18022836a2a4bf62d6b8256f4b84a07aa64 100644 (file)
@@ -31,16 +31,16 @@ use Friendica\Module\BaseApi;
  */
 class Follow extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $cid = Contact::follow($parameters['id'], $uid);
+               $cid = Contact::follow(static::$parameters['id'], $uid);
 
                System::jsonExit(DI::mstdnRelationship()->createFromContactId($cid, $uid)->toArray());
        }
index e1f864acbe930193141ed192aff80c1efc9c5973..3d24da2dfa74aed0911887a1d3e8f33b5100c3cb 100644 (file)
@@ -32,19 +32,18 @@ use Friendica\Module\BaseApi;
 class Followers extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -73,7 +72,7 @@ class Followers extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('contact-relation', ['relation-cid'], $condition, $parameters);
+               $followers = DBA::select('contact-relation', ['relation-cid'], $condition, static::$parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['relation-cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['relation-cid'], $uid);
index e2b963e0c3e1fbe456a2584a88f7e308c2225d63..d3d804704134bb04daf6a68518a54564f581584f 100644 (file)
@@ -32,19 +32,18 @@ use Friendica\Module\BaseApi;
 class Following extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -73,7 +72,7 @@ class Following extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('contact-relation', ['cid'], $condition, $parameters);
+               $followers = DBA::select('contact-relation', ['cid'], $condition, static::$parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index 6abb416d1db3729b1aed2f496c12e3c26a039d24..f36d656f5a6e5e8821c052be52d27acc325c7874 100644 (file)
@@ -30,10 +30,9 @@ use Friendica\Module\BaseApi;
 class IdentityProofs extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index 9086749405fd5ad09d317cba1820c28fc579bbe2..3ec24bcc1a72403578950fcdf4f67163d4050a04 100644 (file)
@@ -33,19 +33,18 @@ use Friendica\Module\BaseApi;
 class Lists extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 1d878269dcfffe43a442c24720bdf740ac318662..b0b14a6146a468f3ee8bacfd5533ba4ee6d525d0 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Mute extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setIgnored($parameters['id'], $uid, true);
+               Contact\User::setIgnored(static::$parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index e6319220244a26e1887540bf1b65b7cc297b9282..ae6e582e8711d72b5fbbb907d8e466840bac6790 100644 (file)
@@ -32,12 +32,12 @@ use Friendica\Module\BaseApi;
  */
 class Note extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -45,13 +45,13 @@ class Note extends BaseApi
                        'comment' => '',
                ]);
 
-               $cdata = Contact::getPublicAndUserContactID($parameters['id'], $uid);
+               $cdata = Contact::getPublicAndUserContactID(static::$parameters['id'], $uid);
                if (empty($cdata['user'])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Contact::update(['info' => $request['comment']], ['id' => $cdata['user']]);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 5631952d2a3f19adb594564c95867d099c980a2e..28135e5eba3772c56e4a446452b33adcc6eba0a6 100644 (file)
@@ -32,10 +32,9 @@ use Friendica\Module\BaseApi;
 class Relationships extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index c31189a4244f20c8e0dec88a57dc15acbba126f3..6b9d2d43f9356298e2efbd43fe7889ff3c41fe18 100644 (file)
@@ -35,10 +35,9 @@ use Friendica\Object\Search\ContactResult;
 class Search extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 0e7a7fb3378e8b506ada310d8699221375ba5c13..c3252d59feac5c013f623f80fdfa198a1fa24fc3 100644 (file)
@@ -37,18 +37,17 @@ use Friendica\Protocol\Activity;
 class Statuses extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
index b1c93ea3622c5b8f2c4cba454d318e046e4315e3..26a1150424d82c540e90c2d5416300bbbf002fac 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Unblock extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setBlocked($parameters['id'], $uid, false);
+               Contact\User::setBlocked(static::$parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 447b1cd652de9b5b0f2148b3f9bd644e66b42ec4..cd7aef7ab1640d98f48c8cfd03d1b4ec4e0da6dd 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Unfollow extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact::unfollow($parameters['id'], $uid);
+               Contact::unfollow(static::$parameters['id'], $uid);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index bc2e50be9145c4ed117521e7040b4add9c74c7db..eb1ad8bfa1d11108466c5977397b846cd030ba84 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Unmute extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Contact\User::setIgnored($parameters['id'], $uid, false);
+               Contact\User::setIgnored(static::$parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnRelationship()->createFromContactId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 449e26fb96e040c903c1f13202524350c83b4dd8..264a2a4a8bcc1b55618a767c389865dfce947b2c 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Util\HTTPInputData;
  */
 class UpdateCredentials extends BaseApi
 {
-       public static function patch(array $parameters = [])
+       public static function patch()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 1c1945438b22accae7df80525ecd6ab57057be08..f91545ee10159ad77c10b662514a2bd536e185ed 100644 (file)
@@ -33,10 +33,9 @@ use Friendica\Module\BaseApi;
 class VerifyCredentials extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 5a414fda10f2309ca69c15421f55832b71a9df3e..23ad0feeb83545ede85a7357599224b8814efb7b 100644 (file)
@@ -30,10 +30,9 @@ use Friendica\Module\BaseApi;
 class Announcements extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index 040607137c9c83ced95c5b458756ea31ba74a69d..adbcd723dad46b802bb13fb85eb5701bd0bb78cc 100644 (file)
@@ -33,10 +33,9 @@ use Friendica\Util\Network;
 class Apps extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $request = self::getRequest([
                        'client_name'   => '',
index e4105f142f2df0e57e1a2ff8683fd60936834ae4..baa3aa7faa82dab1f4dae94279d3b042ff059ca2 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class VerifyCredentials extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $application = self::getCurrentApplication();
index 305914c1aadca10a1846bd99e54fddc50b1d8af2..fbcaf2ded371fb97c7fa0dc5ab2a02bde3fdf969 100644 (file)
@@ -32,19 +32,18 @@ use Friendica\Module\BaseApi;
 class Blocks extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -73,7 +72,7 @@ class Blocks extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('user-contact', ['cid'], $condition, $parameters);
+               $followers = DBA::select('user-contact', ['cid'], $condition, static::$parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index a7141e3dcbbb7d2fbb33a589340beb9973e7d0bd..6cfa08772223e5f0b2e5eb71f56c6b118b0bc0a6 100644 (file)
@@ -34,10 +34,9 @@ use Friendica\Network\HTTPException;
 class Bookmarks extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 22774b57ce03661a29db0ea85e2098b4b3c9bd55..af2632ae6349f8606da9aa10ab4216bf5b013bab 100644 (file)
@@ -31,26 +31,25 @@ use Friendica\Module\BaseApi;
  */
 class Conversations extends BaseApi
 {
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (!empty($parameters['id'])) {
+               if (!empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               DBA::delete('conv', ['id' => $parameters['id'], 'uid' => $uid]);
-               DBA::delete('mail', ['convid' => $parameters['id'], 'uid' => $uid]);
+               DBA::delete('conv', ['id' => static::$parameters['id'], 'uid' => $uid]);
+               DBA::delete('mail', ['convid' => static::$parameters['id'], 'uid' => $uid]);
 
                System::jsonExit([]);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index c469eea3464dc3148cd2581c279cb15eabb80231..b23a95b5e121d1cc80af54990f2624aeff83f0fd 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Module\BaseApi;
  */
 class Read extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (!empty($parameters['id'])) {
+               if (!empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               DBA::update('mail', ['seen' => true], ['convid' => $parameters['id'], 'uid' => $uid]);
+               DBA::update('mail', ['seen' => true], ['convid' => static::$parameters['id'], 'uid' => $uid]);
 
-               System::jsonExit(DI::mstdnConversation()->CreateFromConvId($parameters['id'])->toArray());
+               System::jsonExit(DI::mstdnConversation()->CreateFromConvId(static::$parameters['id'])->toArray());
        }
 }
index a9723414d2e9103121b69c931449aef0c485003e..a16eedf2f30a5c2484482727b7d5f18adb4b8230 100644 (file)
@@ -33,12 +33,11 @@ use Friendica\Network\HTTPException;
 class CustomEmojis extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
 
index 115b02a86fc8e6f52088b82749a5c6db6c569ac6..ec579d2da5e68ebdf7346d501675e95381ddd7dd 100644 (file)
@@ -35,12 +35,11 @@ use Friendica\Network\HTTPException;
 class Directory extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/instance/directory/
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $request = self::getRequest([
                        'offset' => 0,        // How many accounts to skip before returning results. Default 0.
index 9c5e853bc72ea7d929c6cf2356d8d13de63be312..5b90cc48a989251927aabd46c4219dcfd757567a 100644 (file)
@@ -30,10 +30,9 @@ use Friendica\Module\BaseApi;
 class Endorsements extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                System::jsonExit([]);
        }
index 31e760d3b8e0110a9b3bd3cf053ffd514b05b129..f49d35a7bfc9a76bde7008dfd8b955eb312fa655 100644 (file)
@@ -35,10 +35,9 @@ use Friendica\Protocol\Activity;
 class Favourited extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index f14b74a0bd8dd2ef0fb2e9c72c30f2d1c7419707..365ed65f3556a7ee3a02528af7afc325629835c8 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Filters extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -39,10 +39,9 @@ class Filters extends BaseApi
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index bc7cc31bbe83270f6b140224c59d3e9c64e2c13b..2fb548b356e3429b0a7ededc91fc4d9f2be3bb38 100644 (file)
@@ -33,7 +33,6 @@ use Friendica\Network\HTTPException;
 class FollowRequests extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\BadRequestException
         * @throws HTTPException\InternalServerErrorException
         * @throws HTTPException\NotFoundException
@@ -43,16 +42,16 @@ 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(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
 
-               $introduction = DI::intro()->selectOneById($parameters['id'], $uid);
+               $introduction = DI::intro()->selectOneById(static::$parameters['id'], $uid);
 
                $contactId = $introduction->cid;
 
-               switch ($parameters['action']) {
+               switch (static::$parameters['action']) {
                        case 'authorize':
                                Contact\Introduction::confirm($introduction);
                                $relationship = DI::mstdnRelationship()->createFromContactId($contactId, $uid);
@@ -79,12 +78,11 @@ class FollowRequests extends BaseApi
        }
 
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests/
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 2e73a440d034f16e9c19ae59806be4d3346540f9..5f334585349ac3f4ae30afeddd5d006d31b1d40c 100644 (file)
@@ -31,10 +31,9 @@ use Friendica\Object\Api\Mastodon\Instance as InstanceEntity;
 class Instance extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                System::jsonExit(InstanceEntity::get());
        }
index be18a5aa1467c688560de3897d0e4a2df29c7efa..5d4642e0b4ab21f9a7f28da644ebfe3fb079e7df 100644 (file)
@@ -34,10 +34,9 @@ use Friendica\Util\Network;
 class Peers extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $return = [];
 
index 9b7d2dc77f1b0ac02a8a311bcdf93340f65d31df..bb5822702ab883f1e7c7f90500780fdc541ebed8 100644 (file)
@@ -34,10 +34,9 @@ use Friendica\Network\HTTPException;
 class Rules extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $rules = [];
                $id    = 0;
index 8be4207eae5bd5c184c2671d9f02cd0936e7b159..f977ce10394275ca4d51dc68320e135b382eada1 100644 (file)
@@ -31,27 +31,27 @@ use Friendica\Model\Group;
  */
 class Lists extends BaseApi
 {
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!Group::exists($parameters['id'], $uid)) {
+               if (!Group::exists(static::$parameters['id'], $uid)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
-               if (!Group::remove($parameters['id'])) {
+               if (!Group::remove(static::$parameters['id'])) {
                        DI::mstdnError()->InternalError();
                }
 
                System::jsonExit([]);
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -74,30 +74,29 @@ class Lists extends BaseApi
                System::jsonExit(DI::mstdnList()->createFromGroupId($id));
        }
 
-       public static function put(array $parameters = [])
+       public static function put()
        {
                $request = self::getRequest([
                        'title'          => '', // The title of the list to be updated.
                        'replies_policy' => '', // One of: "followed", "list", or "none".
                ]);
 
-               if (empty($request['title']) || empty($parameters['id'])) {
+               if (empty($request['title']) || empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               Group::update($parameters['id'], $request['title']);
+               Group::update(static::$parameters['id'], $request['title']);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        $lists = [];
 
                        $groups = Group::getByUserId($uid);
@@ -106,7 +105,7 @@ class Lists extends BaseApi
                                $lists[] = DI::mstdnList()->createFromGroupId($group['id']);
                        }
                } else {
-                       $id = $parameters['id'];
+                       $id = static::$parameters['id'];
 
                        if (!Group::exists($id, $uid)) {
                                DI::mstdnError()->RecordNotFound();
index b83f4903a9db0cd8d254d9ae165ae60a3364c7a7..0e008602d4ec7504c9d09778f29a958240c28326 100644 (file)
@@ -35,30 +35,29 @@ use Friendica\Module\BaseApi;
  */
 class Accounts extends BaseApi
 {
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                DI::apiResponse()->unsupported(Router::DELETE);
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                DI::apiResponse()->unsupported(Router::POST);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('group', ['id' => $id, 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 394d508d77557ca3e04595535f7f485e49e4aac3..5843585e2464dcd092db3db1aad80e27e11c0e96 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Markers extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -39,10 +39,9 @@ class Markers extends BaseApi
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index b93a06288f72f695edca2e66d6029616e2777ecb..65aa2813922b5add737f492eaf4731f55ee12c4a 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Media extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function put()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -65,34 +65,33 @@ class Media extends BaseApi
                        'focus'       => '', // Two floating points (x,y), comma-delimited ranging from -1.0 to 1.0
                ]);
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $photo = Photo::selectFirst(['resource-id'], ['id' => $parameters['id'], 'uid' => $uid]);
+               $photo = Photo::selectFirst(['resource-id'], ['id' => static::$parameters['id'], 'uid' => $uid]);
                if (empty($photo['resource-id'])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Photo::update(['desc' => $request['description']], ['resource-id' => $photo['resource-id']]);
 
-               System::jsonExit(DI::mstdnAttachment()->createFromPhoto($parameters['id']));
+               System::jsonExit(DI::mstdnAttachment()->createFromPhoto(static::$parameters['id']));
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!Photo::exists(['id' => $id, 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 7939da114b0619061c997825d1951102dcb3f5b6..da9b75dd9925ab16dd643ef4629ddf98a06418fb 100644 (file)
@@ -32,19 +32,18 @@ use Friendica\Module\BaseApi;
 class Mutes extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -73,7 +72,7 @@ class Mutes extends BaseApi
                        $params['order'] = ['cid'];
                }
 
-               $followers = DBA::select('user-contact', ['cid'], $condition, $parameters);
+               $followers = DBA::select('user-contact', ['cid'], $condition, static::$parameters);
                while ($follower = DBA::fetch($followers)) {
                        self::setBoundaries($follower['cid']);
                        $accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);
index a6a024d9b10c81f25211df00951a927534dee8db..3c2e0d4386ac98f7648d643a578ac803f3748c37 100644 (file)
@@ -38,16 +38,15 @@ use Friendica\Protocol\Activity;
 class Notifications extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (!empty($parameters['id'])) {
-                       $id = $parameters['id'];
+               if (!empty(static::$parameters['id'])) {
+                       $id = static::$parameters['id'];
                        try {
                                $notification = DI::notification()->selectOneForUser($uid, ['id' => $id]);
                                System::jsonExit(DI::mstdnNotification()->createFromNotification($notification));
index 9dca0bf65545d3a642d0222e8f6e2ed96d818b40..93639d8a63442eb7f194af7c3ed5d43b00f06785 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class Clear extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index b615c5e890d17aa53dd71bf8679091619eb58727..e3fc3290a118139ed5ebec45f67afe24142e0bc7 100644 (file)
@@ -32,16 +32,16 @@ use Friendica\Network\HTTPException\ForbiddenException;
  */
 class Dismiss extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $Notification = DI::notification()->selectOneForUser($uid, $parameters['id']);
+               $Notification = DI::notification()->selectOneForUser($uid, static::$parameters['id']);
                $Notification->setSeen();
                DI::notification()->save($Notification);
 
index d54bd85fa12cc49db55158f039b6218bec480d39..21361e1f375b684f0f31613570e1daae52135827 100644 (file)
@@ -32,10 +32,9 @@ use Friendica\Module\BaseApi;
 class Preferences extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 1d09a92113d8e5545608be8a4f2827d8f08d7aab..9bdc77f490f6be5bd169cfabfb8967fc09360f1d 100644 (file)
@@ -30,10 +30,9 @@ use Friendica\Module\BaseApi;
 class Proofs extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                System::jsonError(404, ['error' => 'Record not found']);
        }
index 3bc77aeb6fde1268b2cd33a41fc0142a077b2083..715041643903546ab8dd001111175b07e4e01661 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Object\Api\Mastodon\Notification;
  */
 class PushSubscription extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_PUSH);
                $uid         = self::getCurrentUserID();
@@ -112,7 +112,7 @@ class PushSubscription extends BaseApi
                System::jsonExit([]);
        }
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_PUSH);
                $uid         = self::getCurrentUserID();
index 82be0d6e7bd2a72c012adfb9154efccf88dd0b2a..6a4971860f3e43d6703f063f95b0e01a1ac25988 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Module\BaseApi;
  */
 class ScheduledStatuses extends BaseApi
 {
-       public static function put(array $parameters = [])
+       public static function put()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -42,35 +42,34 @@ class ScheduledStatuses extends BaseApi
                DI::apiResponse()->unsupported(Router::PUT);
        }
 
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               if (!DBA::exists('delayed-post', ['id' => $parameters['id'], 'uid' => $uid])) {
+               if (!DBA::exists('delayed-post', ['id' => static::$parameters['id'], 'uid' => $uid])) {
                        DI::mstdnError()->RecordNotFound();
                }
 
-               Post\Delayed::deleteById($parameters['id']);
+               Post\Delayed::deleteById(static::$parameters['id']);
 
                System::jsonExit([]);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (isset($parameters['id'])) {
-                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($parameters['id'], $uid)->toArray());
+               if (isset(static::$parameters['id'])) {
+                       System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId(static::$parameters['id'], $uid)->toArray());
                }
 
                $request = self::getRequest([
index 63190151d7385ced8c547593a4f27f99ab998c2e..d17db271fdcf6bbd57c520bbeca4b101fb8e8123 100644 (file)
@@ -38,10 +38,9 @@ use Friendica\Object\Search\ContactResult;
 class Search extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -74,7 +73,7 @@ class Search extends BaseApi
                        $result['statuses'] = self::searchStatuses($uid, $request['q'], $request['account_id'], $request['max_id'], $request['min_id'], $limit, $request['offset']);
                }
                if ((empty($request['type']) || ($request['type'] == 'hashtags')) && (strpos($request['q'], '@') == false)) {
-                       $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], $parameters['version']);
+                       $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], static::$parameters['version']);
                }
 
                System::jsonExit($result);
index ed5abf1996b9e44cb817b0c43287519627249424..75e22802e203bd0bb721bde51d927e3be63a55a0 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Util\Images;
  */
 class Statuses extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -207,16 +207,16 @@ class Statuses extends BaseApi
                DI::mstdnError()->InternalError();
        }
 
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $parameters['id'], 'uid' => $uid]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => $uid]);
                if (empty($item['id'])) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -229,17 +229,16 @@ class Statuses extends BaseApi
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid));
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid));
        }
 }
index 79be11a4a2dab2c302481a2e376bcc0396f44669..e12c6ecd2240f8a419fcda0248c4eaecace84bd7 100644 (file)
@@ -33,16 +33,16 @@ use Friendica\Module\BaseApi;
  */
 class Bookmark extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -53,6 +53,6 @@ class Bookmark extends BaseApi
 
                Item::update(['starred' => true], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 2fe48255442d0b696fafc1f780bfa5971ba91a17..3c8cf706eda82166685f03c9111da6817001b765 100644 (file)
@@ -33,18 +33,17 @@ use Friendica\Network\HTTPException;
 class Card extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
 
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        throw new HTTPException\NotFoundException('Item with URI ID ' . $id . ' not found' . ($uid ? ' for user ' . $uid : '.'));
index 62397afdbc7a6e2dbbceb5ca5bf817c99654718c..b8a8007212f1b6a7ac62ac77c261abffdf002ce5 100644 (file)
@@ -33,14 +33,13 @@ use Friendica\Module\BaseApi;
 class Context extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -48,7 +47,7 @@ class Context extends BaseApi
                        'limit'    => 40, // Maximum number of results to return. Defaults to 40.
                ]);
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
 
                $parents  = [];
                $children = [];
index a30ad0fe78e63906e20de11856d16490f34c9e95..00844c544bf9c70d205fb4a688be045ca1e9fa3a 100644 (file)
@@ -33,22 +33,22 @@ use Friendica\Module\BaseApi;
  */
 class Favourite extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Item::performActivity($item['id'], 'like', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 67dc4b67fb6a958970343cdd2532bd2c274d2264..5a1a6116a35e3fbfb93dba6410506a974bd296fc 100644 (file)
@@ -33,18 +33,17 @@ use Friendica\Protocol\Activity;
 class FavouritedBy extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        DI::mstdnError()->RecordNotFound();
                }
index 812daff4d4861a569d9718cc4261b12388f02fa5..f9200197f09b46b2247e357f7cef8becaa780437 100644 (file)
@@ -32,16 +32,16 @@ use Friendica\Module\BaseApi;
  */
 class Mute extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Mute extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be muted'));
                }
 
-               Post\ThreadUser::setIgnored($parameters['id'], $uid, true);
+               Post\ThreadUser::setIgnored(static::$parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 1d5498167e3ab33e3848e880a0b9f3153cc6b400..bf6f5bb399e211e638f1a052b69df4031db9eb09 100644 (file)
@@ -32,16 +32,16 @@ use Friendica\Module\BaseApi;
  */
 class Pin extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Pin extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
                }
 
-               Post\ThreadUser::setPinned($parameters['id'], $uid, true);
+               Post\ThreadUser::setPinned(static::$parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 1af7efb827a7e6fb0f4c4d947f01e3aa4df4b59f..0bba905f76357e8afe91a620dd2524bc389dca85 100644 (file)
@@ -35,16 +35,16 @@ use Friendica\Module\BaseApi;
  */
 class Reblog extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -55,6 +55,6 @@ class Reblog extends BaseApi
 
                Item::performActivity($item['id'], 'announce', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 11c15b41e15939b47ee32f330532188363ec6316..06431969adac8f041757a0a68ec25fff1be49137 100644 (file)
@@ -33,18 +33,17 @@ use Friendica\Protocol\Activity;
 class RebloggedBy extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $id = $parameters['id'];
+               $id = static::$parameters['id'];
                if (!Post::exists(['uri-id' => $id, 'uid' => [0, $uid]])) {
                        DI::mstdnError()->RecordNotFound();
                }
index f65b07a345037b3862795cc5a2210ec3dcd156bb..0ddc5891d8291dbbcd8283374f2d8d9086d7369d 100644 (file)
@@ -33,16 +33,16 @@ use Friendica\Module\BaseApi;
  */
 class Unbookmark extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -53,6 +53,6 @@ class Unbookmark extends BaseApi
 
                Item::update(['starred' => false], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index b3fee36822197be4c92fe0a6a218b48c7d597550..4d6460d444ffdefbb9ff8f0ab671627d581534c5 100644 (file)
@@ -33,22 +33,22 @@ use Friendica\Module\BaseApi;
  */
 class Unfavourite extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
 
                Item::performActivity($item['id'], 'unlike', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index ee9b85cc4b41cea7ed01a411b553da5686b4f115..715462880c58dedac351c5428cb71b60f91930f5 100644 (file)
@@ -32,16 +32,16 @@ use Friendica\Module\BaseApi;
  */
 class Unmute extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Unmute extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be unmuted'));
                }
 
-               Post\ThreadUser::setIgnored($parameters['id'], $uid, false);
+               Post\ThreadUser::setIgnored(static::$parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 1f4195cca391023140a4cdeba34caa5b6dd90916..80afaf701551b8a6ef219a8cce1c324b76b9b7da 100644 (file)
@@ -32,16 +32,16 @@ use Friendica\Module\BaseApi;
  */
 class Unpin extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'gravity'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -50,8 +50,8 @@ class Unpin extends BaseApi
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
                }
 
-               Post\ThreadUser::setPinned($parameters['id'], $uid, false);
+               Post\ThreadUser::setPinned(static::$parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index 9450e0f4136af5888fd80bb2a8cd7179429c9e1a..f00d762558ce5a2053fe1da5873c027f66bd5d6d 100644 (file)
@@ -35,16 +35,16 @@ use Friendica\Module\BaseApi;
  */
 class Unreblog extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => $parameters['id'], 'uid' => [$uid, 0]]);
+               $item = Post::selectFirstForUser($uid, ['id', 'network'], ['uri-id' => static::$parameters['id'], 'uid' => [$uid, 0]]);
                if (!DBA::isResult($item)) {
                        DI::mstdnError()->RecordNotFound();
                }
@@ -55,6 +55,6 @@ class Unreblog extends BaseApi
 
                Item::performActivity($item['id'], 'unannounce', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId(static::$parameters['id'], $uid)->toArray());
        }
 }
index e0bb75b2de549a52f7a20f2771f20c26c437ecc2..e7999040baf51f7d67f92eda5dd8623b4939f9b9 100644 (file)
@@ -32,10 +32,9 @@ use Friendica\Module\BaseApi;
 class Suggestions extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 3c3b9c052b0137bedd8321e2c2313ebddd5e96dc..5f8a2e0d74cd212eb1ac7ade62785be69702d6dc 100644 (file)
@@ -33,10 +33,9 @@ use Friendica\Network\HTTPException;
 class Direct extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 2b556d7ce70d87afc9567708efe66dfd2d40adad..7b53171e16ec3c2c376dbc14be2abdcfc1881e96 100644 (file)
@@ -34,10 +34,9 @@ use Friendica\Network\HTTPException;
 class Home extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 8d4a432c5752526c2e57d60785ed50f2a3887db2..9e3219038855cf029de69fd275859bed4eb8123b 100644 (file)
@@ -34,15 +34,14 @@ use Friendica\Network\HTTPException;
 class ListTimeline extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -61,7 +60,7 @@ class ListTimeline extends BaseApi
                $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
 
                $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)",
-                       $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $parameters['id']];
+                       $uid, GRAVITY_PARENT, GRAVITY_COMMENT, static::$parameters['id']];
 
                if (!empty($request['max_id'])) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]);
index ca0141691b96baa14762816063e66fa4be194992..aa55310a7f453d723956c2c1e8835c231d6f3696 100644 (file)
@@ -37,10 +37,9 @@ use Friendica\Network\HTTPException;
 class PublicTimeline extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $uid = self::getCurrentUserID();
 
index 0437be277105aa4da4a9f26818f4baa6b8d151ad..3d87e00948ba686bdfdc8e00e50348295dda6d28 100644 (file)
@@ -35,15 +35,14 @@ use Friendica\Network\HTTPException;
 class Tag extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
 
-               if (empty($parameters['hashtag'])) {
+               if (empty(static::$parameters['hashtag'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
@@ -70,7 +69,7 @@ class Tag extends BaseApi
 
                $condition = ["`name` = ? AND (`uid` = ? OR (`uid` = ? AND NOT `global`))
                        AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))",
-                       $parameters['hashtag'], 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
+                       static::$parameters['hashtag'], 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
 
                if ($request['local']) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
index 505cdbabd1d59ad4e8797469090e9e78d29ab8b1..c7bfa02891ea834566934e53e55ac364f8de9fbf 100644 (file)
@@ -32,10 +32,9 @@ use Friendica\Module\BaseApi;
 class Trends extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $request = self::getRequest([
                        'limit' => 20, // Maximum number of results to return. Defaults to 10.
index 6a0a100c3152c79ca61b75298c395f2327261af3..d346dc7577a5a0f5b48318bcdca57e49650da666 100644 (file)
@@ -31,46 +31,41 @@ use Friendica\Module\BaseApi;
 class Unimplemented extends BaseApi
 {
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                DI::apiResponse()->unsupported(Router::DELETE);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function patch(array $parameters = [])
+       public static function patch()
        {
                DI::apiResponse()->unsupported(Router::PATCH);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function post(array $parameters = [])
+       public static function post()
        {
                DI::apiResponse()->unsupported(Router::POST);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function put(array $parameters = [])
+       public static function put()
        {
                DI::apiResponse()->unsupported(Router::PUT);
        }
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                DI::apiResponse()->unsupported(Router::GET);
        }
index fe422c79f1f4fe66c99dd04385a68905d2576ae3..8dca51c43eb6d557bc20ebc0fff28263831786f8 100644 (file)
@@ -30,9 +30,9 @@ use Friendica\Util\DateTimeFormat;
  */
 class RateLimitStatus extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
+               if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
                        $hash = [
                                'remaining-hits'        => '150',
                                '@attributes'           => ["type" => "integer"],
@@ -52,6 +52,6 @@ class RateLimitStatus extends BaseApi
                        ];
                }
 
-               DI::apiResponse()->exit('hash', ['hash' => $hash], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('hash', ['hash' => $hash], static::$parameters['extension'] ?? null);
        }
 }
index 7e5f11cc6578ff71b9005db575fd2ec9e3dd395c..ddbbfc027ad3a96df570e4443e124ea9ed259831 100644 (file)
@@ -35,9 +35,9 @@ abstract class ContactEndpoint extends BaseApi
        const DEFAULT_COUNT = 20;
        const MAX_COUNT = 200;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
-               parent::init($parameters);
+               parent::init();
 
                self::checkAllowedScope(self::SCOPE_READ);
        }
index 01be503de02f50f78e67d2bbded4fc5f57545f82..0318b5a6864b821681d388d45c305c661a28c4df 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Model\Contact;
  */
 class FollowersIds extends ContactEndpoint
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // Expected value for user_id parameter: public/user contact id
                $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
index 8e39f220199bbb2f6ce551c9126bd6088af040a4..53e56e88ee1f085a05b5ad048a2e682709a2fe59 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Model\Contact;
  */
 class FollowersList extends ContactEndpoint
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // Expected value for user_id parameter: public/user contact id
                $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
index 3500a4043bb43c70c665d13c843608c1a933aec6..4df2f7068ed18c08b25ed529e818bdf455d2c891 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Model\Contact;
  */
 class FriendsIds extends ContactEndpoint
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // Expected value for user_id parameter: public/user contact id
                $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
index 114e391cc39d00cdef800b3245d82ce05adf9d4b..59ae03601b491da5b06db65104ffb3f195242f85 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Model\Contact;
  */
 class FriendsList extends ContactEndpoint
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // Expected value for user_id parameter: public/user contact id
                $contact_id    = filter_input(INPUT_GET, 'user_id'      , FILTER_VALIDATE_INT);
index b2e2c5f0d6b671722fca6e3c39777a587814ffd7..d978af807f7e6872bf7634c1866a619658880ba0 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class SavedSearches extends BaseApi
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -45,6 +45,6 @@ class SavedSearches extends BaseApi
 
                DBA::close($terms);
 
-               DI::apiResponse()->exit('terms', ['terms' => $result], $parameters['extension'] ?? null);
+               DI::apiResponse()->exit('terms', ['terms' => $result], static::$parameters['extension'] ?? null);
        }
 }
index 46dfe41c95a3ab774d076eccca8c98c12e8b05b6..dc3d1d10d79a8a00c729c077d82ea586aeb1a27b 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\DI;
  */
 class Apps extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                $apps = Nav::getAppMenu();
 
index a4bb9b42215cbbcd044d2e843ff0c21576ac5c63..4f9da85c92d7f754ec2b72b77583f670b2789556 100644 (file)
@@ -34,14 +34,14 @@ class Attach extends BaseModule
        /**
         * Return to user an attached file given the id
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $a = DI::app();
-               if (empty($parameters['item'])) {
+               if (empty(static::$parameters['item'])) {
                        throw new \Friendica\Network\HTTPException\BadRequestException();
                }
 
-               $item_id = intval($parameters['item']);
+               $item_id = intval(static::$parameters['item']);
 
                // Check for existence
                $item = MAttach::exists(['id' => $item_id]);
index 69c2879de6bd4fa9c0817e4aad4e747b8947aabc..822b6bdf5c67e7d448aaae3a64441464f0a4625c 100644 (file)
@@ -68,7 +68,7 @@ abstract class BaseAdmin extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                self::checkAdminAccess(true);
 
index a0a94c336f0cf8e9b83bc848f0cdc2b0ec83acf8..b42e9462dc51d6a366584a45ad75af4cd1d46d5f 100644 (file)
@@ -53,7 +53,7 @@ class BaseApi extends BaseModule
         */
        protected static $request = [];
 
-       public static function delete(array $parameters = [])
+       public static function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -62,7 +62,7 @@ class BaseApi extends BaseModule
                }
        }
 
-       public static function patch(array $parameters = [])
+       public static function patch()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -71,7 +71,7 @@ class BaseApi extends BaseModule
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -80,7 +80,7 @@ class BaseApi extends BaseModule
                }
        }
 
-       public static function put(array $parameters = [])
+       public static function put()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -139,7 +139,6 @@ class BaseApi extends BaseModule
         * Set boundaries for the "link" header
         * @param array $boundaries
         * @param int $id
-        * @return array
         */
        protected static function setBoundaries(int $id)
        {
index e7f9bdabe374508328eec7d0a446f33677b025c0..3987c9056786ee2e314a806d411abda362a3680d 100644 (file)
@@ -82,7 +82,7 @@ abstract class BaseNotifications extends BaseModule
         */
        abstract public static function getNotifications();
 
-       public static function init(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function rawContent()
        {
                // If the last argument of the query is NOT json, return
                if (DI::args()->get(DI::args()->getArgc() - 1) !== 'json') {
index c2516e134cf04508602500d1294c7c0cf1d81ba1..1a20fc3dc97caf0f9107456c0a07d4d9bdf6f821 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\DI;
 
 class BaseSettings extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
index 3551cfd1756beb5f35ee7ad69f6acf43c8e3d97b..408fb50b25eec78226accf43916a6a52a89d28b5 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
  */
 class Bookmarklet extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $_GET['mode'] = 'minimal';
 
index 4f13b284334d10d7d8032fd6cebb81e86d9ec512..d80abe47026e8075066879cfea40f17173065e1a 100644 (file)
@@ -96,7 +96,7 @@ class Contact extends BaseModule
                DI::baseUrl()->redirect($redirectUrl);
        }
 
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [], $update = 0)
+       public static function content($update = 0)
        {
                if (!local_user()) {
                        return Login::form($_SERVER['REQUEST_URI']);
index 29de7bd6febc2b0b0875333b3fdf11890253e15f..521e4f469f841a27e8d7fc801096db4082940973 100644 (file)
@@ -38,16 +38,16 @@ use Friendica\Util\Strings;
  */
 class Advanced extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!Session::isAuthenticated()) {
                        throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
-               $cid = $parameters['id'];
+               $cid = static::$parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
@@ -96,9 +96,9 @@ class Advanced extends BaseModule
                return;
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               $cid = $parameters['id'];
+               $cid = static::$parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
index b75dea43db25d04c597ce63e9bafb6370293cd37..1e3e582c0e55a1355303d0bb0a3d73239cc61f5c 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
 
 class Contacts extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $app = DI::app();
 
@@ -22,8 +22,8 @@ class Contacts extends BaseModule
                        throw new HTTPException\ForbiddenException();
                }
 
-               $cid = $parameters['id'];
-               $type = $parameters['type'] ?? 'all';
+               $cid = static::$parameters['id'];
+               $type = static::$parameters['type'] ?? 'all';
                $accounttype = $_GET['accounttype'] ?? '';
                $accounttypeid = User::getAccountTypeByString($accounttype);
 
index 57d4ac6ab6cf44880118d3d168c683b8a4b5fd8a..2de1a0f8aee52b80223a1bb9bb70ec1082c1843c 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Strings;
  */
 class Hovercard extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $contact_url = $_REQUEST['url'] ?? '';
 
index 956c33ac8d039697a51156d998c6e651b7752e72..d854aa9d6385bb2a20c3980c2e90e89f24c55409 100644 (file)
@@ -34,9 +34,9 @@ use Friendica\Network\HTTPException\BadRequestException;
  */
 class Media extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               $cid = $parameters['id'];
+               $cid = static::$parameters['id'];
 
                $contact = Model\Contact::selectFirst([], ['id' => $cid]);
                if (empty($contact)) {
index d9dd7e27aa4f964b309b5051ac7af99142d72bff..7f3e596db7f89d64c4d3739d7cd75314b2896598 100644 (file)
@@ -18,9 +18,9 @@ use Friendica\Util\XML;
 
 class Poke extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
-               if (!local_user() || empty($parameters['id'])) {
+               if (!local_user() || empty(static::$parameters['id'])) {
                        return self::postReturn(false);
                }
 
@@ -39,14 +39,14 @@ class Poke extends BaseModule
 
                $activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]);
 
-               $contact_id = intval($parameters['id']);
+               $contact_id = intval(static::$parameters['id']);
                if (!$contact_id) {
                        return self::postReturn(false);
                }
 
                Logger::info('verb ' . $verb . ' contact ' . $contact_id);
 
-               $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $parameters['id'], 'uid' => local_user()]);
+               $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
                if (!DBA::isResult($contact)) {
                        return self::postReturn(false);
                }
@@ -123,17 +123,17 @@ class Poke extends BaseModule
                return $success;
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
                }
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => $parameters['id'], 'uid' => local_user()]);
+               $contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
                if (!DBA::isResult($contact)) {
                        throw new HTTPException\NotFoundException();
                }
index e9b5a442433c5300a82e7d781fd20460b46815b3..5730d569a35b1f92b2ffd77402b434cf33af599a 100644 (file)
@@ -37,13 +37,13 @@ class Revoke extends BaseModule
        /** @var array */
        private static $contact;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
                }
 
-               $data = Model\Contact::getPublicAndUserContactID($parameters['id'], local_user());
+               $data = Model\Contact::getPublicAndUserContactID(static::$parameters['id'], local_user());
                if (!DBA::isResult($data)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown contact.'));
                }
@@ -63,13 +63,13 @@ class Revoke extends BaseModule
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException();
                }
 
-               self::checkFormSecurityTokenRedirectOnError('contact/' . $parameters['id'], 'contact_revoke');
+               self::checkFormSecurityTokenRedirectOnError('contact/' . static::$parameters['id'], 'contact_revoke');
 
                $result = Model\Contact::revokeFollow(self::$contact);
                if ($result === true) {
@@ -80,10 +80,10 @@ class Revoke extends BaseModule
                        notice(DI::l10n()->t('Unable to revoke follow, please try again later or contact the administrator.'));
                }
 
-               DI::baseUrl()->redirect('contact/' . $parameters['id']);
+               DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
        }
 
-       public static function content(array $parameters = []): string
+       public static function content(): string
        {
                if (!local_user()) {
                        return Login::form($_SERVER['REQUEST_URI']);
index 3a30f379950fdfeecfd68c3f75a530808e5b717d..9a6e0709f12ea7f49cefa8c43e76b3fff737ff86 100644 (file)
@@ -49,9 +49,9 @@ class Community extends BaseModule
        protected static $max_id;
        protected static $item_id;
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               self::parseRequest($parameters);
+               self::parseRequest();
 
                if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
                        $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
@@ -94,8 +94,8 @@ class Community extends BaseModule
        
                        if (local_user() && DI::config()->get('system', 'community_no_sharer')) {
                                $path = self::$content;
-                               if (!empty($parameters['accounttype'])) {
-                                       $path .= '/' . $parameters['accounttype'];
+                               if (!empty(static::$parameters['accounttype'])) {
+                                       $path .= '/' . static::$parameters['accounttype'];
                                }
                                $query_parameters = [];
                
@@ -166,11 +166,10 @@ class Community extends BaseModule
        /**
         * Computes module parameters from the request and local configuration
         *
-        * @param array $parameters
         * @throws HTTPException\BadRequestException
         * @throws HTTPException\ForbiddenException
         */
-       protected static function parseRequest(array $parameters)
+       protected static function parseRequest()
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
@@ -182,10 +181,10 @@ class Community extends BaseModule
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
                }
 
-               self::$accountTypeString = $_GET['accounttype'] ?? $parameters['accounttype'] ?? '';
+               self::$accountTypeString = $_GET['accounttype'] ?? static::$parameters['accounttype'] ?? '';
                self::$accountType = User::getAccountTypeByString(self::$accountTypeString);
 
-               self::$content = $parameters['content'] ?? '';
+               self::$content = static::$parameters['content'] ?? '';
                if (!self::$content) {
                        if (!empty(DI::config()->get('system', 'singleuser'))) {
                                // On single user systems only the global page does make sense
index f2dc1fae1c744f98550d48c84d0bcaa3e70c32a3..87bce10307c1a545bea877faf4c2c50f882457cc 100644 (file)
@@ -57,13 +57,13 @@ class Network extends BaseModule
        /** @var string */
        protected static $order;
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form();
                }
 
-               self::parseRequest($parameters, $_GET);
+               self::parseRequest($_GET);
 
                $module = 'network';
 
@@ -272,11 +272,11 @@ class Network extends BaseModule
                return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]);
        }
 
-       protected static function parseRequest(array $parameters, array $get)
+       protected static function parseRequest(array $get)
        {
-               self::$groupId = $parameters['group_id'] ?? 0;
+               self::$groupId = static::$parameters['group_id'] ?? 0;
 
-               self::$forumContactId = $parameters['contact_id'] ?? 0;
+               self::$forumContactId = static::$parameters['contact_id'] ?? 0;
 
                self::$selectedTab = Session::get('network-tab', DI::pConfig()->get(local_user(), 'network.view', 'selected_tab', ''));
 
@@ -317,13 +317,13 @@ class Network extends BaseModule
                Session::set('network-tab', self::$selectedTab);
                DI::pConfig()->set(local_user(), 'network.view', 'selected_tab', self::$selectedTab);
 
-               self::$accountTypeString = $get['accounttype'] ?? $parameters['accounttype'] ?? '';
+               self::$accountTypeString = $get['accounttype'] ?? static::$parameters['accounttype'] ?? '';
                self::$accountType = User::getAccountTypeByString(self::$accountTypeString);
 
                self::$network = $get['nets'] ?? '';
 
-               self::$dateFrom = $parameters['from'] ?? '';
-               self::$dateTo = $parameters['to'] ?? '';
+               self::$dateFrom = static::$parameters['from'] ?? '';
+               self::$dateTo = static::$parameters['to'] ?? '';
 
                if (DI::mode()->isMobile()) {
                        self::$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
index 1a586a808d4400c8e29943d9b98112e1d31b5b8f..cf3a4ca3424cd27aefb809a8773487a1db46d046 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\DI;
  */
 class Credits extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                /* fill the page with credits */
                $credits_string = file_get_contents('CREDITS.txt');
index 6aeb23417e1062cac7b7484d257fb84e10564078..a02913adadfe25b29184e8e7d46eb52bcc99a97b 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
  */
 class Notify extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $postdata = Network::postdata();
 
@@ -47,8 +47,8 @@ class Notify extends BaseModule
                }
 
                $data = json_decode($postdata);
-               if (is_object($data) && !empty($parameters['nickname'])) {
-                       $user = User::getByNickname($parameters['nickname']);
+               if (is_object($data) && !empty(static::$parameters['nickname'])) {
+                       $user = User::getByNickname(static::$parameters['nickname']);
                        if (empty($user)) {
                                throw new \Friendica\Network\HTTPException\InternalServerErrorException();
                        }
index d9c7884ec00a374b34220d24340ee4a1971aa006..9a2ab4b69f24d1ac75320527b45c6a9acc9e8191 100644 (file)
@@ -29,11 +29,11 @@ use Friendica\Protocol\OStatus;
  */
 class Poll extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                header("Content-type: application/atom+xml");
                $last_update = $_GET['last_update'] ?? '';
-               echo OStatus::feed($parameters['nickname'], $last_update, 10);
+               echo OStatus::feed(static::$parameters['nickname'], $last_update, 10);
                exit();
        }
 }
index 854f557d0c791d5584a3b1ac1b0d81b70473eda8..2a06a672c91a0262cb05811afd8ee190746bc63c 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\XML;
 
 class ActivityPubConversion extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                function visible_whitespace($s)
                {
index ff8bc874110820494fce2bb908abeb0f5a239d44..4901684b6a611692c4740e3f032e6ef735ecd4cf 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\XML;
  */
 class Babel extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                function visible_whitespace($s)
                {
index 5ef6816682c4abc9793fc6fb43525e895306d8cf..0c0c0ded4d1798d0b95ac4b768a6fdd61a9df9a3 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Protocol;
  */
 class Feed extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                $result = [];
                if (!empty($_REQUEST['url'])) {
index 2299b3cb21302dfc9ddd8a871efb1ccec292c079..70308964682abe1ef20c4ee9263bc7b9383df5ab 100644 (file)
@@ -31,17 +31,17 @@ use Friendica\Network\HTTPException;
  */
 class ItemBody extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
                }
 
-               if (empty($parameters['item'])) {
+               if (empty(static::$parameters['item'])) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Item not found.'));
                }
 
-               $itemId = intval($parameters['item']);
+               $itemId = intval(static::$parameters['item']);
 
                $item = Post::selectFirst(['body'], ['uid' => [0, local_user()], 'uri-id' => $itemId]);
 
index ff1466408e922152f0dfb481aa092c88938153d2..2d784765dd23dcbc5eccadd2b0a5962b1d859edf 100644 (file)
@@ -31,7 +31,7 @@ class Localtime extends BaseModule
 {
        static $mod_localtime = '';
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
@@ -42,7 +42,7 @@ class Localtime extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
index 304096b2ec0e57b337fc0cbe4a1470b347836ee1..24c8d745c52b1f2abb334178b2ab6913710f2bd8 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\Probe as NetworkProbe;
  */
 class Probe extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
index e8a619f0b9dedca12222592b867afadb37b15e34..f95d7a2b960ed8e4855ad28deda3b80598d32eb8 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Network\Probe;
  */
 class WebFinger extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
index 12f8c5074cbe26db122cd2f27a17a22560071c0d..b4845764c3bd51c6c86b9083858ef1fe3e13bcdf 100644 (file)
@@ -37,7 +37,7 @@ use Friendica\Util\Proxy;
  */
 class Delegation extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -112,7 +112,7 @@ class Delegation extends BaseModule
                // NOTREACHED
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
index 55eeea9b5534f8b2e482919db40b8c834b09817b..dc3e76b010cebb757bf8de7995e49a0637f18834 100644 (file)
@@ -38,13 +38,13 @@ use Friendica\Util\Strings;
  */
 class Fetch extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['guid'])) {
+               if (empty(static::$parameters['guid'])) {
                        throw new HTTPException\NotFoundException();
                }
 
-               $guid = $parameters['guid'];
+               $guid = static::$parameters['guid'];
 
                // Fetch the item
                $condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid,
index dc6fb716b75f19c0215b2b57c5cb7b4d1d6a394a..2fde1fe3f2374b356d5c3834b3bd17b4d0be0efe 100644 (file)
@@ -38,12 +38,12 @@ class Receive extends BaseModule
        /** @var LoggerInterface */
        private static $logger;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
                self::$logger = DI::logger();
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $enabled = DI::config()->get('system', 'diaspora_enabled', false);
                if (!$enabled) {
@@ -51,10 +51,10 @@ class Receive extends BaseModule
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
                }
 
-               if ($parameters['type'] === 'public') {
+               if (static::$parameters['type'] === 'public') {
                        self::receivePublic();
-               } else if ($parameters['type'] === 'users') {
-                       self::receiveUser($parameters['guid']);
+               } else if (static::$parameters['type'] === 'users') {
+                       self::receiveUser(static::$parameters['guid']);
                }
        }
 
index 0172612d51f0346c0a6f3a81d6ba06f39760aef3..799b18ea10ad4058905570145209245eb3663c58 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
  */
 class Directory extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $app = DI::app();
                $config = DI::config();
index 50e468a9c7ba2429c7324c9678a31261fde20acb..befd8d7aaeff403eedf02e1eda16e5b9ac99eea1 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Util\Temporal;
 
 class Json extends \Friendica\BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException();
index 788f9da7c2587650c99f4fa0fa12a11291cea230..0eca46b1ab8b108e947936e1ff766ec6bc388f4a 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Protocol\Feed as ProtocolFeed;
  */
 class Feed extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
@@ -68,7 +68,7 @@ class Feed extends BaseModule
                }
 
                header("Content-type: application/atom+xml; charset=utf-8");
-               echo ProtocolFeed::atom($parameters['nickname'], $last_update, 10, $type, $nocache, true);
+               echo ProtocolFeed::atom(static::$parameters['nickname'], $last_update, 10, $type, $nocache, true);
                exit();
        }
 }
index 8c65f43814d147b7e8b4857d00bf08ee207bec94..e52db81c1252aeb2f47545baf8aaaed1699c4555 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\XML;
  */
 class RemoveTag extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException();
@@ -41,7 +41,7 @@ class RemoveTag extends BaseModule
 
                $logger = DI::logger();
 
-               $item_id = $parameters['id'] ?? 0;
+               $item_id = static::$parameters['id'] ?? 0;
 
                $term = XML::unescape(trim($_GET['term'] ?? ''));
                $cat = XML::unescape(trim($_GET['cat'] ?? ''));
index 50f6c2e9b1462e2e90c8f2eacfc6260fbae16127..363e51c2107f4afc8d370f1b0dbc39b2a56282ee 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\XML;
  */
 class SaveTag extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('You must be logged in to use this module'));
@@ -42,13 +42,13 @@ class SaveTag extends BaseModule
                }
        }
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $logger = DI::logger();
 
                $term = XML::unescape(trim($_GET['term'] ?? ''));
 
-               $item_id = $parameters['id'] ?? 0;
+               $item_id = static::$parameters['id'] ?? 0;
 
                $logger->info('filer', ['tag' => $term, 'item' => $item_id]);
 
index 75153512b6d49286179b7b7e0ff300d2c1309abe..6e6b4da1df224c46a1967060daadee474a18582b 100644 (file)
@@ -10,7 +10,7 @@ use Friendica\Model\Contact;
  */
 class FollowConfirm extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $uid = local_user();
                if (!$uid) {
index 78e75bc314897a7a02aa33342321582492cf363a..3256a04c2bbdf865fc7291f25da55479f9ad0fa7 100644 (file)
@@ -38,16 +38,16 @@ use Friendica\Worker\Delivery;
  */
 class FriendSuggest extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
-               $cid = intval($parameters['contact']);
+               $cid = intval(static::$parameters['contact']);
 
                // We do query the "uid" as well to ensure that it is our contact
                if (!DI::dba()->exists('contact', ['id' => $cid, 'uid' => local_user()])) {
@@ -83,9 +83,9 @@ class FriendSuggest extends BaseModule
                info(DI::l10n()->t('Friend suggestion sent.'));
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               $cid = intval($parameters['contact']);
+               $cid = intval(static::$parameters['contact']);
 
                $contact = DI::dba()->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
                if (empty($contact)) {
index 95a319a41a962ec699da798e249951a3a728d6c4..082c5c0812ec71394a40a4d8c647868aaccf2fae 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Protocol\ActivityPub;
  */
 class Friendica extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $config = DI::config();
 
@@ -110,7 +110,7 @@ class Friendica extends BaseModule
                ]);
        }
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (ActivityPub::isRequest()) {
                        try {
index ee6c7b8c275b9e08fb6786f79d2b9c6a94fa5836..69baef9f4df481cef3b43a5b2cf1248bce0eb600 100644 (file)
@@ -32,7 +32,7 @@ require_once 'boot.php';
 
 class Group extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $a = DI::app();
 
@@ -138,7 +138,7 @@ class Group extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $change = false;
 
index 079f240ae4b72b1fafc82cc1ec416570e8f170bc..269deff0682491b7a9ea702dcd31dcf8784ae5e9 100644 (file)
@@ -34,14 +34,14 @@ use Friendica\Network\HTTPException;
  */
 class HCard extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               if ((local_user()) && ($parameters['action'] ?? '') === 'view') {
+               if ((local_user()) && (static::$parameters['action'] ?? '') === 'view') {
                        // A logged in user views a profile of a user
                        $nickname = DI::app()->getLoggedInUserNickname();
-               } elseif (empty($parameters['action'])) {
+               } elseif (empty(static::$parameters['action'])) {
                        // Show the profile hCard
-                       $nickname = $parameters['profile'];
+                       $nickname = static::$parameters['profile'];
                } else {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('No profile'));
                }
index f100bba492acc5b1352733b7d4b30f9f650443df..87458324686a6e7486789c613568ff1027eae5d1 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Network\HTTPException;
 
 class MethodNotAllowed extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
        }
index 746773ef1269b23e32b3dcc4675b32ecc118cbf4..5ba5466241ce52473088bf89626fd7fc24241f82 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Network\HTTPException;
 
 class PageNotFound extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
        }
index cdf0de6c16d11221d10ddae96f09247a2a92251b..aebe15dd0d0e325e8d3ffa979ec7751af8264fe6 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\Strings;
  */
 class Hashtag extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $result = [];
 
index 219adc797342a9bf81a0edc548a355bdedf6a7ab..5440fd97d8a33c63d2d359528f20c5e0ac864268 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException;
  */
 class Help extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                Nav::setSelected('help');
 
index 9d16e11aa7f6eb6c457c9377b4790fe707db9a6b..719d87452242b75f0cf7307969c6d4b7e9285515 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\Security\Login;
  */
 class Home extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $app = DI::app();
                $config = DI::config();
index 8b6f97f984a56cb1cf9d29abb524391dd3e01355..72b83ebffd3155843a5bd5f18dcf5f015b618e4a 100644 (file)
@@ -65,7 +65,7 @@ class Install extends BaseModule
         */
        private static $installer;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
                $a = DI::app();
 
@@ -94,7 +94,7 @@ class Install extends BaseModule
                self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $a           = DI::app();
                $configCache = $a->getConfigCache();
@@ -177,7 +177,7 @@ class Install extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a           = DI::app();
                $configCache = $a->getConfigCache();
index 65438c15146f828a608a5fe76241f5fc4c9c6879..3c82a26c1448cd637f8ed80ec50069e2a3f80ba9 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Strings;
  */
 class Invite extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 1d44bf995775fa9abfafeabd316edc2a1f71ecc9..6006be9c7d4e2b5b328c076872d227506762dd78 100644 (file)
@@ -38,18 +38,18 @@ use Friendica\Network\HTTPException;
  */
 class Activity extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException();
                }
 
-               if (empty($parameters['id']) || empty($parameters['verb'])) {
+               if (empty(static::$parameters['id']) || empty(static::$parameters['verb'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $verb = $parameters['verb'];
-               $itemId =  $parameters['id'];
+               $verb = static::$parameters['verb'];
+               $itemId =  static::$parameters['id'];
 
                if (in_array($verb, ['announce', 'unannounce'])) {
                        $item = Post::selectFirst(['network'], ['id' => $itemId]);
index f81b0c89692588cf754daf1d7baa314d217213f4..c229fb15aeb5f81b4e8c0a18be41dee50a8ec207 100644 (file)
@@ -40,7 +40,7 @@ use Friendica\Util\Temporal;
 
 class Compose extends BaseModule
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!empty($_REQUEST['body'])) {
                        $_REQUEST['return'] = 'network';
@@ -51,7 +51,7 @@ class Compose extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form('compose', false);
@@ -64,7 +64,7 @@ class Compose extends BaseModule
                }
 
                /// @TODO Retrieve parameter from router
-               $posttype = $parameters['type'] ?? Item::PT_ARTICLE;
+               $posttype = static::$parameters['type'] ?? Item::PT_ARTICLE;
                if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) {
                        switch ($posttype) {
                                case 'note':
index d67af70e45048eeaef7dd4b6ce33c7cf107609a0..923048447b4cdc28c0cb0ccf0bd6ba8f41e6333f 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class Follow extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $l10n = DI::l10n();
 
@@ -42,11 +42,11 @@ class Follow extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval($parameters['id']);
+               $itemId = intval(static::$parameters['id']);
 
                if (!Item::performActivity($itemId, 'follow', local_user())) {
                        throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
index d38c19bb9ad54dccf9e1e8761244d577d6245be0..19ac90e47c0cd8d5168905234165e466f14ce9fc 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
  */
 class Ignore extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $l10n = DI::l10n();
 
@@ -41,11 +41,11 @@ class Ignore extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval($parameters['id']);
+               $itemId = intval(static::$parameters['id']);
 
                $dba = DI::dba();
 
index b8022cf57c1f5f0cc018a589071f2ac297202e23..c451bae480d626af5bba90ba2b6c26e186500de9 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class Pin extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $l10n = DI::l10n();
 
@@ -42,11 +42,11 @@ class Pin extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval($parameters['id']);
+               $itemId = intval(static::$parameters['id']);
 
                $item = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId]);
                if (!DBA::isResult($item)) {
index c39b6a11a0520b6c65474f8894ae91a2e04b496f..d24fb54ac7f1e322c168493650e10a24d51f8dd1 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Network\HTTPException;
  */
 class Star extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $l10n = DI::l10n();
 
@@ -43,11 +43,11 @@ class Star extends BaseModule
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty($parameters['id'])) {
+               if (empty(static::$parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval($parameters['id']);
+               $itemId = intval(static::$parameters['id']);
 
 
                $item = Post::selectFirstForUser(local_user(), ['uid', 'uri-id', 'starred'], ['uid' => [0, local_user()], 'id' => $itemId]);
index c51c05844cbecadf9f5d5bd27e2b35b9f0fdcc84..63f8ee9c1c54029428b4a24cea33520306c6c4c5 100644 (file)
@@ -39,7 +39,7 @@ use Friendica\Util\Strings;
  */
 class Magic extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                $a = DI::app();
                $ret = ['success' => false, 'url' => '', 'message' => ''];
index be70e7a5c7debc910a22c34ef70b211ea759c037..d13c5fe02762bfb70bf8b4a58be509b6eadca5a8 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
  */
 class Maintenance extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $reason = DI::config()->get('system', 'maintenance_reason');
 
index 0f9112d11f0efd799be7cc48c3e625236f0ae073..4a226ac63fa160375a519f042f8a9386ceb1ccf9 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\DI;
 
 class Manifest extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index 2530038969679eee6136259fd071d460af385002..96e4d7658decc23253da1d3fe1d47fdc50e6f317 100644 (file)
@@ -35,14 +35,14 @@ use Friendica\Model\User;
  */
 class NoScrape extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $a = DI::app();
 
-               if (isset($parameters['nick'])) {
+               if (isset(static::$parameters['nick'])) {
                        // Get infos about a specific nick (public)
-                       $which = $parameters['nick'];
-               } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') {
+                       $which = static::$parameters['nick'];
+               } elseif (local_user() && isset(static::$parameters['profile']) && DI::args()->get(2) == 'view') {
                        // view infos about a known profile (needs a login)
                        $which = $a->getLoggedInUserNickname();
                } else {
index 5248c662bff9a63e62bf492cc03ce04cc4a177ec..3923b7e21c52b1e2d65537cf7b52c9dba11c258d 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo110 extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index 0eb6e793f90de42655e683cfcdc316e9cdb1cf00..471f0f212f7d1d4323128e83ad92afb271862ccf 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo120 extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index 5ea9c0e6833ec846a45042937bb489581cb93698..02324a92bed902c65deb46e827edbd63e13ff94f 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo210 extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index 9bc9f40b0a8b70450d1a8ff741cf2e2a9ae350d6..234175dd8822aa0558596282fc3b6259dfb78023 100644 (file)
@@ -55,7 +55,7 @@ class Introductions extends BaseNotifications
                ];
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                Nav::setSelected('introductions');
 
index 64ab459f1232fa603dedeb5378ef6ba7a6b93eaa..5c27abbbba76786e34613f96bb2bb703fed2316e 100644 (file)
@@ -42,13 +42,13 @@ class Notification extends BaseModule
         * @throws \ImagickException
         * @throws \Exception
         */
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
                }
 
-               $request_id = $parameters['id'] ?? false;
+               $request_id = static::$parameters['id'] ?? false;
 
                if ($request_id) {
                        $intro = DI::intro()->selectOneById($request_id, local_user());
@@ -73,7 +73,7 @@ class Notification extends BaseModule
         *
         * @throws HTTPException\UnauthorizedException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
@@ -101,14 +101,14 @@ class Notification extends BaseModule
         * @throws HTTPException\InternalServerErrorException
         * @throws \Exception
         */
-       public static function content(array $parameters = []): string
+       public static function content(): string
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('You must be logged in to show this page.'));
                        return Login::form();
                }
 
-               $request_id = $parameters['id'] ?? false;
+               $request_id = static::$parameters['id'] ?? false;
 
                if ($request_id) {
                        $Notify = DI::notify()->selectOneById($request_id);
index a0e40719c0e6e64a7784c18102459749e1ae603a..9b43647e9a61ef552ad416e2cc1908abfeb10939 100644 (file)
@@ -82,7 +82,7 @@ class Notifications extends BaseNotifications
                ];
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                Nav::setSelected('notifications');
 
index 6f7ac945b974964d0d47eb5911c5b83865953dd7..ffce1caae3ce558887d49fd82dd58beead90befb 100644 (file)
@@ -30,13 +30,13 @@ use Friendica\Module\BaseApi;
  */
 class Acknowledge extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                DI::session()->set('oauth_acknowledge', true);
                DI::app()->redirect(DI::session()->get('return_path'));
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                DI::session()->set('return_path', $_REQUEST['return_path'] ?? '');
 
index cf5187d947fbea804027c7da0df9d7b9383fa5b5..ede46720a32806b6adbc53d219a3cde1c3bd03b3 100644 (file)
@@ -35,10 +35,9 @@ class Authorize extends BaseApi
        private static $oauth_code = '';
 
        /**
-        * @param array $parameters
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function rawContent(array $parameters = [])
+       public static 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.
@@ -98,7 +97,7 @@ class Authorize extends BaseApi
                self::$oauth_code = $token['code'];
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (empty(self::$oauth_code)) {
                        return '';
index 519e79db015f449d60543541bbc85128595faf55..156ef1c199332ef401b86a222e65ea566deef192 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Revoke extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $request = self::getRequest([
                        'client_id'     => '', // Client ID, obtained during app registration
index f104e96721cade401da8bab4aa36a9f317e8712e..2ef26cbf1bb2056646fd56c68962a176ef713600 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Security\OAuth;
  */
 class Token extends BaseApi
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                $request = self::getRequest([
                        'client_id'     => '', // Client ID, obtained during app registration
index 0d6fb8ee521c72dd4f0f037c63e3bc50efef421e..5564fdacaa05418f90d4d1f958ff18743bd6f8c6 100644 (file)
@@ -37,7 +37,7 @@ use Friendica\Util\Strings;
  */
 class Oembed extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                // Unused form: /oembed/b2h?url=...
                if (DI::args()->getArgv()[1] == 'b2h') {
index df37706874e16d6120da413ea3b381aeeaf1ce73..a6393726d7e4867f26ae79d9c106a79be855fd8e 100644 (file)
@@ -36,7 +36,7 @@ class OpenSearch extends BaseModule
        /**
         * @throws \Exception
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                header('Content-type: application/opensearchdescription+xml');
 
index 5b87e6a4f196f6ee10436703107899c66d8aae7a..a46734987837b4f5186c18b24de5e179aef6fb63 100644 (file)
@@ -44,7 +44,7 @@ use Friendica\Util\Strings;
  */
 class Owa extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
 
                $ret = [ 'success' => false ];
index 0b1548ed5ef4f00964fb71e3308818f019b12d04..f8665c535714a2f42f5d4642a7f125ef33228768 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util;
 
 class ParseUrl extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!Session::isAuthenticated()) {
                        throw new \Friendica\Network\HTTPException\ForbiddenException();
index 7599c2f060bdffb13942c2c9c58de5b3ddd0d611..89ed260f9c22e0b704f05a5ac37419a6604fcfa3 100644 (file)
@@ -15,10 +15,10 @@ use Friendica\Network\HTTPException;
  */
 class PermissionTooltip extends \Friendica\BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               $type = $parameters['type'];
-               $referenceId = $parameters['id'];
+               $type = static::$parameters['type'];
+               $referenceId = static::$parameters['id'];
 
                $expectedTypes = ['item', 'photo', 'event'];
                if (!in_array($type, $expectedTypes)) {
index 399313e3f5c428816d89404b1dbc47837376343c..2a45ef047808f4f74a19873d43043a51cb6fe5e4 100644 (file)
@@ -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(array $parameters = [])
+       public static function rawContent()
        {
                $totalstamp = microtime(true);
 
@@ -77,14 +77,14 @@ class Photo extends BaseModule
                $scale = null;
                $stamp = microtime(true);
                // User avatar
-               if (!empty($parameters['type'])) {
-                       if (!empty($parameters['customsize'])) {
-                               $customsize = intval($parameters['customsize']);
-                               $square_resize = !in_array($parameters['type'], ['media', 'preview']);
+               if (!empty(static::$parameters['type'])) {
+                       if (!empty(static::$parameters['customsize'])) {
+                               $customsize = intval(static::$parameters['customsize']);
+                               $square_resize = !in_array(static::$parameters['type'], ['media', 'preview']);
                        }
 
-                       if (!empty($parameters['guid'])) {
-                               $guid = $parameters['guid'];
+                       if (!empty(static::$parameters['guid'])) {
+                               $guid = static::$parameters['guid'];
                                $account = DBA::selectFirst('account-user-view', ['id'], ['guid' => $guid], ['order' => ['uid' => true]]);
                                if (empty($account)) {
                                        throw new HTTPException\NotFoundException();
@@ -94,12 +94,12 @@ class Photo extends BaseModule
                        }
 
                        // Contact Id Fallback, to remove after version 2021.12
-                       if (isset($parameters['contact_id'])) {
-                               $id = intval($parameters['contact_id']);
+                       if (isset(static::$parameters['contact_id'])) {
+                               $id = intval(static::$parameters['contact_id']);
                        }
 
-                       if (!empty($parameters['nickname_ext'])) {
-                               $nickname = pathinfo($parameters['nickname_ext'], PATHINFO_FILENAME);
+                       if (!empty(static::$parameters['nickname_ext'])) {
+                               $nickname = pathinfo(static::$parameters['nickname_ext'], PATHINFO_FILENAME);
                                $user = User::getByNickname($nickname, ['uid']);
                                if (empty($user)) {
                                        throw new HTTPException\NotFoundException();
@@ -109,23 +109,23 @@ class Photo extends BaseModule
                        }
 
                        // User Id Fallback, to remove after version 2021.12
-                       if (!empty($parameters['uid_ext'])) {
-                               $id = intval(pathinfo($parameters['uid_ext'], PATHINFO_FILENAME));
+                       if (!empty(static::$parameters['uid_ext'])) {
+                               $id = intval(pathinfo(static::$parameters['uid_ext'], PATHINFO_FILENAME));
                        }
 
                        // Please refactor this for the love of everything that's good
-                       if (isset($parameters['id'])) {
-                               $id = $parameters['id'];
+                       if (isset(static::$parameters['id'])) {
+                               $id = static::$parameters['id'];
                        }
 
                        if (empty($id)) {
-                               Logger::notice('No picture id was detected', ['parameters' => $parameters, 'query' => DI::args()->getQueryString()]);
+                               Logger::notice('No picture id was detected', ['parameters' => static::$parameters, 'query' => DI::args()->getQueryString()]);
                                throw new HTTPException\NotFoundException(DI::l10n()->t('The Photo is not available.'));
                        }
 
-                       $photo = self::getPhotoByid($id, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
+                       $photo = self::getPhotoByid($id, static::$parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
                } else {
-                       $photoid = pathinfo($parameters['name'], PATHINFO_FILENAME);
+                       $photoid = pathinfo(static::$parameters['name'], PATHINFO_FILENAME);
                        $scale = 0;
                        if (substr($photoid, -2, 1) == "-") {
                                $scale = intval(substr($photoid, -1, 1));
index 7138ac73fdb5404075070b874f56ac082c7c2909..a46973967989b346a3c8984efaad7d051c9c6b1c 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Network\HTTPException;
 
 class Common extends BaseProfile
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@@ -45,7 +45,7 @@ class Common extends BaseProfile
 
                Nav::setSelected('home');
 
-               $nickname = $parameters['nickname'];
+               $nickname = static::$parameters['nickname'];
 
                $profile = Profile::load($a, $nickname);
                if (empty($profile)) {
index 94f301557b57c7f9bd0eea81bc7c514f65673f3f..0f28be641cdcc6a9697773f9db64ea5d6e5d1587 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
 
 class Contacts extends Module\BaseProfile
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@@ -42,8 +42,8 @@ class Contacts extends Module\BaseProfile
 
                $a = DI::app();
 
-               $nickname = $parameters['nickname'];
-               $type = $parameters['type'] ?? 'all';
+               $nickname = static::$parameters['nickname'];
+               $type = static::$parameters['type'] ?? 'all';
 
                $profile = Model\Profile::load($a, $nickname);
                if (empty($profile)) {
index 5334ac932fc33b473dbd89aae6e286fe56abadb3..4f46efaa332aad59b3cf9100ffa00da84a176880 100644 (file)
@@ -34,13 +34,13 @@ use Friendica\BaseModule;
  */
 class Index extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               Profile::rawContent($parameters);
+               Profile::rawContent();
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               return Status::content($parameters);
+               return Status::content();
        }
 }
index e10597199e8ae82c9adf1e048f1c2267e4b5c06e..f46097814f5ea0484d5679068212c81a60c73409 100644 (file)
@@ -29,11 +29,11 @@ use Friendica\Network\HTTPException;
 
 class Media extends BaseProfile
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, $parameters['nickname']);
+               $profile = ProfileModel::load($a, static::$parameters['nickname']);
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
index 25b6eccc9abdb6c6514239985483420b19b6e43c..c1792ad4e6980e47a112c6c4853dfe1efea3fda2 100644 (file)
@@ -46,10 +46,10 @@ use Friendica\Util\Temporal;
 
 class Profile extends BaseProfile
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (ActivityPub::isRequest()) {
-                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => $parameters['nickname']]);
+                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
                        if (DBA::isResult($user)) {
                                try {
                                        $data = ActivityPub\Transmitter::getProfile($user['uid']);
@@ -61,9 +61,9 @@ class Profile extends BaseProfile
                                }
                        }
 
-                       if (DBA::exists('userd', ['username' => $parameters['nickname']])) {
+                       if (DBA::exists('userd', ['username' => static::$parameters['nickname']])) {
                                // Known deleted user
-                               $data = ActivityPub\Transmitter::getDeletedUser($parameters['nickname']);
+                               $data = ActivityPub\Transmitter::getDeletedUser(static::$parameters['nickname']);
 
                                System::jsonError(410, $data);
                        } else {
@@ -73,11 +73,11 @@ class Profile extends BaseProfile
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, $parameters['nickname']);
+               $profile = ProfileModel::load($a, static::$parameters['nickname']);
                if (!$profile) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('Profile not found.'));
                }
@@ -98,7 +98,7 @@ class Profile extends BaseProfile
                        DI::page()['htmlhead'] .= '<meta name="friendica.community" content="true" />' . "\n";
                }
 
-               DI::page()['htmlhead'] .= self::buildHtmlHead($profile, $parameters['nickname'], $remote_contact_id);
+               DI::page()['htmlhead'] .= self::buildHtmlHead($profile, static::$parameters['nickname'], $remote_contact_id);
 
                Nav::setSelected('home');
 
@@ -134,7 +134,7 @@ class Profile extends BaseProfile
                                $view_as_contact_alert = DI::l10n()->t(
                                        'You\'re currently viewing your profile as <b>%s</b> <a href="%s" class="btn btn-sm pull-right">Cancel</a>',
                                        htmlentities($view_as_contacts[$key]['name'], ENT_COMPAT, 'UTF-8'),
-                                       'profile/' . $parameters['nickname'] . '/profile'
+                                       'profile/' . static::$parameters['nickname'] . '/profile'
                                );
                        }
                }
index e72b1c7a656191cd15abce4d003bd3949570189c..eaeeb85406ec70b7d70603aaad4c09e900a0e57c 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\DateTimeFormat;
 
 class Schedule extends BaseProfile
 {
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -80,7 +80,7 @@ class Schedule extends BaseProfile
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
                        '$baseurl'             => DI::baseUrl()->get(true),
                        '$title'               => DI::l10n()->t('Scheduled Posts'),
-                       '$nickname'            => $parameters['nickname'] ?? '',
+                       '$nickname'            => static::$parameters['nickname'] ?? '',
                        '$scheduled_at'        => DI::l10n()->t('Scheduled'),
                        '$content'             => DI::l10n()->t('Content'),
                        '$delete'              => DI::l10n()->t('Remove post'),
index e93fc5699e005ff76841992ef63bb2a5d2275ebd..995939ce7ce824a5f75f05dace7c5fb2236350f0 100644 (file)
@@ -46,13 +46,13 @@ use Friendica\Util\XML;
 
 class Status extends BaseProfile
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $args = DI::args();
 
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, $parameters['nickname']);
+               $profile = ProfileModel::load($a, static::$parameters['nickname']);
 
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
@@ -62,10 +62,10 @@ class Status extends BaseProfile
                        DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
                }
 
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . $parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
-               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . static::$parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
+               DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . static::$parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
 
                $category = $datequery = $datequery2 = '';
 
index 86b8a95cbb607a03183856a378bacbeebeaef2c3..a9c8c0b9e6361e6fce9a9d685feb516694296128 100644 (file)
@@ -44,9 +44,9 @@ class Proxy extends BaseModule
        /**
         * Fetch remote image content
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               $request = self::getRequestInfo($parameters);
+               $request = self::getRequestInfo();
 
                if (!DI::config()->get('system', 'proxify_content')) {
                        Logger::notice('Proxy access is forbidden', ['request' => $request, 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'accept' => $_SERVER['HTTP_ACCEPT'] ?? '']);
@@ -119,13 +119,13 @@ class Proxy extends BaseModule
         *    ]
         * @throws \Exception
         */
-       private static function getRequestInfo(array $parameters)
+       private static function getRequestInfo()
        {
                $size = ProxyUtils::PIXEL_LARGE;
                $sizetype = '';
 
-               if (!empty($parameters['url']) && empty($_REQUEST['url'])) {
-                       $url = $parameters['url'];
+               if (!empty(static::$parameters['url']) && empty($_REQUEST['url'])) {
+                       $url = static::$parameters['url'];
 
                        // thumb, small, medium and large.
                        if (substr($url, -6) == ':micro') {
index a13130d1c98bdd86e2c2b49b0db0483ffd447348..22269984a8d182c51bd080c50e706b7e62fa7f5d 100644 (file)
@@ -33,13 +33,13 @@ use Friendica\Util\Strings;
  */
 class PublicRSAKey extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               if (empty($parameters['nick'])) {
+               if (empty(static::$parameters['nick'])) {
                        throw new BadRequestException();
                }
 
-               $nick = $parameters['nick'];
+               $nick = static::$parameters['nick'];
 
                $user = User::getByNickname($nick, ['spubkey']);
                if (empty($user) || empty($user['spubkey'])) {
index df1a987d2e8ab1ac9b22a6ca6933965e0e1ffc50..b50746701d078053b5419bf1fb1ad6294750abd1 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Model\Contact;
  */
 class RandomProfile extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
index 8d6a6ff3c282bed97127812cacf9dcecdadb52c0..50b9660020374f3d7f0b5743ecabd62941d49d65 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\XML;
  */
 class ReallySimpleDiscovery extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                header('Content-Type: text/xml');
 
index 909e61a998688f6e4118140ced1f3ffbd3cdcaa7..7c0d3f690d11872b5f0e37c27be353310cb9dffc 100644 (file)
@@ -53,7 +53,7 @@ class Register extends BaseModule
         *
         * @return string
         */
-       public static function content(array $parameters = [])
+       public static function content()
        {
                // logged in users can register others (people/pages/groups)
                // even with closed registrations, unless specifically prohibited by site policy.
@@ -129,7 +129,7 @@ class Register extends BaseModule
 
                $tpl = $arr['template'];
 
-               $tos = new Tos();
+               $tos = new Tos(static::$parameters);
 
                $o = Renderer::replaceMacros($tpl, [
                        '$invitations'  => DI::config()->get('system', 'invitation_only'),
@@ -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(array $parameters = [])
+       public static function post()
        {
                BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
 
index f1e653f1ce56f185d50dc2aa0553c00ae62974aa..df67e60c65a6be5326be53f95a89090e0092e62b 100644 (file)
@@ -42,9 +42,9 @@ class RemoteFollow extends BaseModule
 {
        static $owner;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
-               self::$owner = User::getOwnerDataByNick($parameters['profile']);
+               self::$owner = User::getOwnerDataByNick(static::$parameters['profile']);
                if (!self::$owner) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
@@ -52,7 +52,7 @@ class RemoteFollow extends BaseModule
                DI::page()['aside'] = Widget\VCard::getHTML(self::$owner);
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
                        DI::baseUrl()->redirect();
@@ -96,7 +96,7 @@ class RemoteFollow extends BaseModule
                System::externalRedirect($follow_link);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (empty(self::$owner)) {
                        return '';
@@ -115,7 +115,7 @@ class RemoteFollow extends BaseModule
                        '$submit'        => DI::l10n()->t('Submit Request'),
                        '$cancel'        => DI::l10n()->t('Cancel'),
 
-                       '$request'       => 'remote_follow/' . $parameters['profile'],
+                       '$request'       => 'remote_follow/' . static::$parameters['profile'],
                        '$name'          => self::$owner['name'],
                        '$myaddr'        => Profile::getMyURL(),
                ]);
index 63abcf36e8d9633b07d5a0106c9098318ca53dff..c2b2d624ddf650d7e10eaac5f584bb6af561d6e2 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\BaseModule;
  */
 class RobotsTxt extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $allDisalloweds = [
                        '/settings/',
index 636e09539f1208a9c70c65308baf163747b16f49..8ec8dd9bbb45adc0b9f6b23984edf38ad22ebf32 100644 (file)
@@ -48,7 +48,7 @@ class Acl extends BaseModule
        const TYPE_PRIVATE_MESSAGE       = 'm';
        const TYPE_ANY_CONTACT           = 'a';
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
index 692122155f0288ce1c5a4829b28f1d9904a12dc8..5b5a1ba2855dbdb73e763bbea7749515f6e2e555 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\Security\Login;
  */
 class Directory extends BaseSearch
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('Permission denied.'));
index 7bfc14f6f573b5ccb9152d83f509f694f65876cd..f3cad86208c991c29cb4a6487bb962a0f12d57a6 100644 (file)
@@ -17,7 +17,7 @@ use Friendica\Module\Security\Login;
 
 class Filed extends BaseSearch
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form();
index 769d5f90d2a2ee9862097f68bf795b4a43e63e87..941b4c577030425cbc7665dbb1a456ba70507cf1 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Network\HTTPException;
 
 class Index extends BaseSearch
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $search = (!empty($_GET['q']) ? trim(rawurldecode($_GET['q'])) : '');
 
index d5cc15ceea3f0da5476e26da020c77b747df468a..436e3f9589631d527c7a873c226fab6b6f281790 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\DI;
 
 class Saved extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                $action = DI::args()->get(2, 'none');
                $search = trim(rawurldecode($_GET['term'] ?? ''));
index 0e49234809bc76aa6d3ce5d618f11a99316f60af..e157ac0898f733f1cd80201d62688a19a6934d40 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\Register;
  */
 class Login extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $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(array $parameters = [])
+       public static function post()
        {
                $return_path = Session::get('return_path');
                Session::clear();
index 1724ae297e497d8579dec7ce66b9dc350fd0fda6..35658797ce4c1c4de69748d329911025b122c85d 100644 (file)
@@ -36,7 +36,7 @@ class Logout extends BaseModule
        /**
         * Process logout requests
         */
-       public static function init(array $parameters = [])
+       public static function init()
        {
                $visitor_home = null;
                if (remote_user()) {
index 8e8613c4e917d4b250d4b6fa907905eebc5b33db..4459b2cf8c989b98b096f50d28af31031bfe4f15 100644 (file)
@@ -31,7 +31,7 @@ use LightOpenID;
  */
 class OpenID extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (DI::config()->get('system', 'no_openid')) {
                        DI::baseUrl()->redirect();
index d93146cb6cc3ed0a56d5c3810ecd17df6d084a02..5bcf6add8ed99a9faaf53c104c23c7ee09d994ec 100644 (file)
@@ -35,14 +35,14 @@ use Friendica\Security\TwoFactor\Model\RecoveryCode;
  */
 class Recovery extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -67,7 +67,7 @@ class Recovery extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        DI::baseUrl()->redirect();
index 22c757b82deacfdc7558a668f6bbfb8161fb6f56..3209b3f56dbbb8a973c21e944bc50aea0741c4db 100644 (file)
@@ -38,7 +38,7 @@ class Verify extends BaseModule
 {
        private static $errors = [];
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -78,7 +78,7 @@ class Verify extends BaseModule
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        DI::baseUrl()->redirect();
index 067304ee8a82053cd2be0f264fe64a15c66eaf9f..f98583a2a25cd8b7778f1b7111d6ce1d7d495efe 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Util\Strings;
  */
 class Delegation extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -62,9 +62,9 @@ class Delegation extends BaseSettings
                DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 5429a11e237930eeae7c94bebdb0b868aeca87ab..42632fe0f8882abc1ab6bebbc714d483a6112267 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Network\HTTPException;
  */
 class Display extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -112,9 +112,9 @@ class Display extends BaseSettings
                DI::baseUrl()->redirect('settings/display');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
-               parent::content($parameters);
+               parent::content();
 
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 28e8430eaa8e18c563b81508e700810ce604e35c..8b2510050f3ad479f37ed4b8992cacd7c5abaee9 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Util\Temporal;
 
 class Index extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -135,7 +135,7 @@ class Index extends BaseSettings
                DI::baseUrl()->redirect('settings/profile');
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('You must be logged in to use this module'));
index 104b6f653ea357284a64dc0b5d2c0605a64dd840..b983674383c7d62bf9864ad8430bcb95d84e7132 100644 (file)
@@ -33,13 +33,13 @@ use Friendica\Network\HTTPException;
 
 class Crop extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!Session::isAuthenticated()) {
                        return;
                }
 
-               $photo_prefix = $parameters['guid'];
+               $photo_prefix = static::$parameters['guid'];
                $resource_id = $photo_prefix;
                $scale = 0;
                if (substr($photo_prefix, -2, 1) == '-') {
@@ -160,7 +160,7 @@ class Crop extends BaseSettings
                DI::baseUrl()->redirect($path);
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -168,7 +168,7 @@ class Crop extends BaseSettings
 
                parent::content();
 
-               $resource_id = $parameters['guid'];
+               $resource_id = static::$parameters['guid'];
 
                $photos = Photo::selectToArray([], ['resource-id' => $resource_id, 'uid' => local_user()], ['order' => ['scale' => false]]);
                if (!DBA::isResult($photos)) {
index cda71a7c69e47cf6a9a59902570190c1bc28422a..423d0971e877615f87b398490a95df1d2814c025 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
 
 class Index extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 29d6b19c56a3b750c7ec1289b9282d9e721c4d3b..21304d10e1c50d8f557709241dd2cfcfdf43bf20 100644 (file)
@@ -36,7 +36,7 @@ class AppSpecific extends BaseSettings
 {
        private static $appSpecificPassword = null;
 
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
@@ -54,7 +54,7 @@ class AppSpecific extends BaseSettings
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -97,13 +97,13 @@ class AppSpecific extends BaseSettings
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/app_specific');
                }
 
-               parent::content($parameters);
+               parent::content();
 
                $appSpecificPasswords = AppSpecificPassword::getListForUser(local_user());
 
index 3bb3a2aa1f5e2145aedc09409cc8df96ebf98e56..b173a092d4f2d757907e36821aef400bb6a3982d 100644 (file)
@@ -33,7 +33,7 @@ use PragmaRX\Google2FA\Google2FA;
 
 class Index extends BaseSettings
 {
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -94,13 +94,13 @@ class Index extends BaseSettings
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form('settings/2fa');
                }
 
-               parent::content($parameters);
+               parent::content();
 
                $has_secret = (bool) DI::pConfig()->get(local_user(), '2fa', 'secret');
                $verified = DI::pConfig()->get(local_user(), '2fa', 'verified');
index eac3da919a2e522a42a27f39b0b5e2f437b31e90..25832d2e6f2cbbd9e58293fdc8ebbb68cd2e0051 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Module\Security\Login;
  */
 class Recovery extends BaseSettings
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
@@ -52,7 +52,7 @@ class Recovery extends BaseSettings
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -69,13 +69,13 @@ class Recovery extends BaseSettings
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/recovery');
                }
 
-               parent::content($parameters);
+               parent::content();
 
                if (!RecoveryCode::countValidForUser(local_user())) {
                        RecoveryCode::generateForUser(local_user());
index 753250941732f095885887ed58fb524767015311..c719dc58157ece95f3d646b4011e6a10bffefb5e 100644 (file)
@@ -14,7 +14,7 @@ use UAParser\Parser;
  */
 class Trusted extends BaseSettings
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
@@ -32,7 +32,7 @@ class Trusted extends BaseSettings
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -64,9 +64,9 @@ class Trusted extends BaseSettings
        }
 
 
-       public static function content(array $parameters = []): string
+       public static function content(): string
        {
-               parent::content($parameters);
+               parent::content();
 
                $trustedBrowserRepository = new TwoFactor\Repository\TrustedBrowser(DI::dba(), DI::logger());
                $trustedBrowsers = $trustedBrowserRepository->selectAllByUid(local_user());
index a4106c260c972821bc39a2860a43c8cea1cc9ce8..27c9631d4e4def4f2e1061099bc550323cadaaf6 100644 (file)
@@ -39,7 +39,7 @@ use PragmaRX\Google2FA\Google2FA;
  */
 class Verify extends BaseSettings
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!local_user()) {
                        return;
@@ -58,7 +58,7 @@ class Verify extends BaseSettings
                }
        }
 
-       public static function post(array $parameters = [])
+       public static function post()
        {
                if (!local_user()) {
                        return;
@@ -84,13 +84,13 @@ class Verify extends BaseSettings
                }
        }
 
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/verify');
                }
 
-               parent::content($parameters);
+               parent::content();
 
                $company = 'Friendica';
                $holder = Session::get('my_address');
index aad76c4fbcbf1ed9382d231fb41be8b3dcd20f3c..27e82c4cf81fe451a64e593e14d7e814d60f3663 100644 (file)
@@ -47,18 +47,17 @@ class UserExport extends BaseSettings
         * If there is an action required through the URL / path, react
         * accordingly and export the requested data.
         *
-        * @param array $parameters Router-supplied parameters
         * @return string
         * @throws HTTPException\ForbiddenException
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function content(array $parameters = [])
+       public static function content()
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
-               parent::content($parameters);
+               parent::content();
 
                /**
                 * options shown on "Export personal data" page
@@ -84,10 +83,9 @@ class UserExport extends BaseSettings
         * to the browser which then offers a save / open dialog
         * to the user.
         *
-        * @param array $parameters Router-supplied parameters
         * @throws HTTPException\ForbiddenException
         */
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 8ee641b5a6db67236ccb0344b489da051362c68c..1ffff65c07273dfc7ab63166e6e4824acd906306 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\DI;
  */
 class Smilies extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static 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(array $parameters = [])
+       public static function content()
        {
                $smilies = Content\Smilies::getList();
                $count = count($smilies['texts'] ?? []);
index e9d9eca020ba270ce00d85a6637baa2c8fb7405f..6b6e4316505d5c048c20ad8a21a46bc47cb386bb 100644 (file)
@@ -28,14 +28,14 @@ use Friendica\Network\HTTPException\NotFoundException;
 
 class Statistics extends BaseModule
 {
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (!DI::config()->get("system", "nodeinfo")) {
                        throw new NotFoundException();
                }
        }
 
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
                $logger = DI::logger();
index 1282fc783f47e8161f18180d2c82ab66b597826d..201558ab7925290598c7f71dafdad2b7652d2249 100644 (file)
@@ -30,11 +30,11 @@ use Friendica\Util\Strings;
  */
 class Theme extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                header('Content-Type: text/css');
 
-               $theme = Strings::sanitizeFilePathItem($parameters['theme']);
+               $theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
 
                if (file_exists("view/theme/$theme/theme.php")) {
                        require_once "view/theme/$theme/theme.php";
index 48c417412849b4817cfa2f2d506484cfcb0e8672..0f45af13c52c1bee4d99404046166afbf99a34a6 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Core\Theme;
  */
 class ThemeDetails extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!empty($_REQUEST['theme'])) {
                        $theme = $_REQUEST['theme'];
index 11e8259d595f969fefcf361906c97b6c55c54b2a..7cf53633a0fb893f973b12529c7ec135d53a5482 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\DI;
  */
 class ToggleMobile extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $a = DI::app();
 
index 34834d41c13becbd41cb59fc22b31c53b5808531..1c91641f531537a6164b865e28313c45f5243b84 100644 (file)
@@ -41,8 +41,10 @@ class Tos extends BaseModule
         * be properties of the class, however cannot be set directly as the property
         * cannot depend on a function result when declaring the variable.
         **/
-       public function __construct()
+       public function __construct(array $parameters = [])
        {
+               parent::__construct($parameters);
+
                $this->privacy_operate = DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
                $this->privacy_distribute = DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
                $this->privacy_delete = DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
@@ -58,7 +60,7 @@ class Tos extends BaseModule
         * dealings with their own node so a TOS is not necessary.
         *
         **/
-       public static function init(array $parameters = [])
+       public static function init()
        {
                if (strlen(DI::config()->get('system','singleuser'))) {
                        DI::baseUrl()->redirect('profile/' . DI::config()->get('system','singleuser'));
@@ -77,7 +79,7 @@ class Tos extends BaseModule
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function content(array $parameters = []) {
+       public static function content() {
                $tpl = Renderer::getMarkupTemplate('tos.tpl');
                if (DI::config()->get('system', 'tosdisplay')) {
                        return Renderer::replaceMacros($tpl, [
@@ -90,7 +92,7 @@ class Tos extends BaseModule
                                '$privacy_delete' => DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
                        ]);
                } else {
-                       return;
+                       return '';
                }
        }
 }
index 78d6f0bd35bd1e3f1b3c4b9e9ae6b4a39e996218..84d2b3a9fcb1e763329a01898d4f67b6e99ad42a 100644 (file)
@@ -33,9 +33,9 @@ use Friendica\Module\Conversation\Community as CommunityModule;
  */
 class Community extends CommunityModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
-               self::parseRequest($parameters);
+               self::parseRequest();
 
                $o = '';
                if (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update')) {
index df37c82a81f08ee4b4361620598603fb6128a126..c6e5225d6fb32b88230b3eb76a5a1ac41ba15103 100644 (file)
@@ -9,13 +9,13 @@ use Friendica\Module\Conversation\Network as NetworkModule;
 
 class Network extends NetworkModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                if (!isset($_GET['p']) || !isset($_GET['item'])) {
                        exit();
                }
 
-               self::parseRequest($parameters, $_GET);
+               self::parseRequest($_GET);
 
                $profile_uid = intval($_GET['p']);
 
index cc738f501e2d4f3a92e3ce5f47afaf5894245210..2e9f676f83d7d8a6ee3217810cab760e95f0368b 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\DateTimeFormat;
 
 class Profile extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $a = DI::app();
 
index 1c8209b59ff9778f674f748302ca5e26984c854b..c14df0160a029d2269ebd03baea7042d9a57ba64 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\DI;
  */
 class Welcome extends BaseModule
 {
-       public static function content(array $parameters = [])
+       public static function content()
        {
                $config = DI::config();
 
index 219eb3609b39c6f4cf7775860d4b227151040813..14a3a17fe5a72de81a185a17502ae9032f79f705 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Crypto;
  */
 class HostMeta extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index a8d0768929f20f0b58253c511782857a5e4a3c4e..f1d8164cb98cce05ae08fa842889725abf966f0e 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\DI;
  */
 class NodeInfo extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                self::printWellKnown();
        }
index c0cdc4e51538aa22b3dce9590ac6c10bdd9ba9f0..317db50feb3acdf18b44dbc370b2da6c6fd6a04e 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\BaseModule;
  */
 class SecurityTxt extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $name = 'security.txt';
                $fp = fopen($name, 'rt');
index 96968680dc7f3126f3a81da9a786187869337978..a66feac039eaa2a44842b89df9ff5f8f318f11b8 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Protocol\Relay;
  */
 class XSocialRelay extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                $config = DI::config();
 
index 66404f4567d30b06887620af5a7dadbd79168044..459059a55f2e47829d318397cda42166f7b4f6a9 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Protocol\Salmon;
  */
 class Xrd extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       public static function rawContent()
        {
                // @TODO: Replace with parameter from router
                if (DI::args()->getArgv()[0] == 'xrd') {