]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Accounts.php
Make BaseModule methods dynamic
[friendica.git] / src / Module / Api / Mastodon / Accounts.php
index 781547854aada3932d0e753ad33726b608ba2e94..13981684f08d9e32d0a2a86749c22e2089d38dbd 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 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();
                        }
                }