]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Thu, 28 Jul 2022 22:06:49 +0000 (00:06 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 28 Jul 2022 22:08:38 +0000 (00:08 +0200)
- fixed wrong type-hint uid => int
- added returned type-hint
- added some documentation
- formatted arrays a bit

src/Model/OpenWebAuthToken.php
src/Module/Diaspora/Receive.php
src/Protocol/Diaspora.php

index b57356a9864b1a4e56e0b4fca18b6c101e47bd57..a91097599e3705ddfb4297aa384f1efa4c38d765 100644 (file)
@@ -39,13 +39,13 @@ class OpenWebAuthToken
         * @return boolean
         * @throws \Exception
         */
-       public static function create(string $type, uid $uid, string $token, string $meta)
+       public static function create(string $type, int $uid, string $token, string $meta)
        {
                $fields = [
-                       'type' => $type,
-                       'uid' => $uid,
-                       'token' => $token,
-                       'meta' => $meta,
+                       'type'    => $type,
+                       'uid'     => $uid,
+                       'token'   => $token,
+                       'meta'    => $meta,
                        'created' => DateTimeFormat::utcNow()
                ];
                return DBA::insert('openwebauth-token', $fields);
index 3b1049361880fcc59b76c61ef02cf9c62a6ef8c9..ce102df06d32cba70f7888dbd3dae168f969e878 100644 (file)
@@ -67,6 +67,7 @@ class Receive extends BaseModule
        /**
         * Receive a public Diaspora posting
         *
+        * @return void
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
@@ -84,6 +85,7 @@ class Receive extends BaseModule
        /**
         * Receive a Diaspora posting for a user
         *
+        * @return void
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
@@ -127,7 +129,7 @@ class Receive extends BaseModule
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       private function decodePost(bool $public = true, string $privKey = '')
+       private function decodePost(bool $public = true, string $privKey = ''): array
        {
                if (empty($_POST['xml'])) {
 
index 5c0f9b81314cfda8edc1abf20cea431f3197656f..cc029366958f65981ec080fe1b062e3f833e5fa3 100644 (file)
@@ -1357,15 +1357,15 @@ class Diaspora
                }
 
                $fields = [
-                       'url' => $data['url'],
-                       'nurl' => Strings::normaliseLink($data['url']),
-                       'name' => $data['name'],
-                       'nick' => $data['nick'],
-                       'addr' => $data['addr'],
-                       'batch' => $data['batch'],
-                       'notify' => $data['notify'],
-                       'poll' => $data['poll'],
-                       'network' => $data['network']
+                       'url'     => $data['url'],
+                       'nurl'    => Strings::normaliseLink($data['url']),
+                       'name'    => $data['name'],
+                       'nick'    => $data['nick'],
+                       'addr'    => $data['addr'],
+                       'batch'   => $data['batch'],
+                       'notify'  => $data['notify'],
+                       'poll'    => $data['poll'],
+                       'network' => $data['network'],
                ];
 
                Contact::update($fields, ['addr' => $old_handle]);