]> git.mxchange.org Git - friendica.git/commitdiff
fix errors in Protocoll namespace
authorArt4 <art4@wlabs.de>
Fri, 6 Dec 2024 22:55:58 +0000 (22:55 +0000)
committerArt4 <art4@wlabs.de>
Fri, 6 Dec 2024 22:55:58 +0000 (22:55 +0000)
src/BaseEntity.php
src/Protocol/ActivityPub/ClientToServer.php
src/Protocol/ActivityPub/Fetch.php
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/Diaspora/Entity/DiasporaContact.php
src/Protocol/Diaspora/Repository/DiasporaContact.php
src/Protocol/Email.php

index f50e72e837fffab6f7036b9f548a4a9177783e95..090851db477d78932bcbb9563b809d688bc92cbf 100644 (file)
@@ -52,6 +52,26 @@ use Psr\Http\Message\UriInterface;
  * @property-read string $user_agent
  * @property-read bool $trusted
  * @property-read string|null $last_used
+ * @property-read string $guid
+ * @property-read string $addr
+ * @property-read UriInterface $alias
+ * @property-read string $nick
+ * @property-read string $givenName
+ * @property-read string $familyName
+ * @property-read UriInterface $photoMedium
+ * @property-read UriInterface $photoSmall
+ * @property-read UriInterface $batch
+ * @property-read UriInterface $notify
+ * @property-read UriInterface $poll
+ * @property-read string $subscribe
+ * @property-read bool $searchable
+ * @property-read string $pubKey
+ * @property-read UriInterface $baseurl
+ * @property-read int $gsid
+ * @property-read \DateTime $updated
+ * @property-read int $interacting_count
+ * @property-read int $interacted_count
+ * @property-read int $post_count
  */
 abstract class BaseEntity extends BaseDataTransferObject
 {
index 4f3a8268b078646a1ec066bf294a92682eca850e..989d12bea0f428ffa386adbcb0c01e9be4170a1c 100644 (file)
@@ -307,7 +307,6 @@ class ClientToServer
         * @param integer $page      Page number
         * @param integer $max_id    Maximum ID
         * @param string  $requester URL of requesting account
-        * @param boolean $nocache   Wether to bypass caching
         * @return array of posts
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
index b188c54ec4b95f1a4d91bfe86dfd6d433b65a752..fa7b52996b9bcd2ea30ad4a41bbd8cddaac48af0 100644 (file)
@@ -29,8 +29,6 @@ class Fetch
        /**
         * Set the worker id for the queue entry
         *
-        * @param array $activity
-        * @param int   $wid
         * @return void
         */
        public static function setWorkerId(string $url, int $wid)
@@ -45,9 +43,6 @@ class Fetch
 
        /**
         * Check if there is an assigned worker task
-        *
-        * @param array $activity
-        * @return bool
         */
        public static function hasWorker(string $url): bool
        {
index 7eeae65ae5399a0f6c449ff6377d11aad78e66b8..b50397dc75e49cfe17202ea34fd3361bb3683f9a 100644 (file)
@@ -1449,7 +1449,7 @@ class Processor
         * @return int|bool New mail table row id or false on error
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       private static function postMail(array $item): bool
+       private static function postMail(array $item)
        {
                if (($item['gravity'] != Item::GRAVITY_PARENT) && !DBA::exists('mail', ['uri' => $item['thr-parent'], 'uid' => $item['uid']])) {
                        Logger::info('Parent not found, mail will be discarded.', ['uid' => $item['uid'], 'uri' => $item['thr-parent']]);
index 0aeccc3867c55215b0dbd0d5b2eec9409a58dccb..1f03bd2118ded4324094cc156c362b61849d86c1 100644 (file)
@@ -19,7 +19,6 @@ use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\APContact;
 use Friendica\Model\Contact;
-use Friendica\Model\GServer;
 use Friendica\Model\Item;
 use Friendica\Model\Photo;
 use Friendica\Model\Post;
@@ -904,10 +903,6 @@ class Transmitter
 
        /**
         * Get a list of receivers for the provided uri-id
-        *
-        * @param array $item
-        * @param boolean $blindcopy
-        * @return array
         */
        public static function getReceiversForUriId(int $uri_id, bool $blindcopy): array
        {
@@ -1344,8 +1339,6 @@ class Transmitter
        /**
         * Creates an activity array for a given URI-Id and uid
         *
-        * @param integer $uri_id
-        * @param integer $uid
         * @param boolean $object_mode       true = Create the object, false = create the activity with the object
         * @param boolean $api_mode          true = used for the API
         * @param boolean $announce_activity true = the announced object is the activity, false = we announce the object link
@@ -1370,7 +1363,6 @@ class Transmitter
        /**
         * Creates an activity array for a given item id
         *
-        * @param integer $item_id
         * @param boolean $object_mode       true = Create the object, false = create the activity with the object
         * @param boolean $api_mode          true = used for the API
         * @param boolean $announce_activity true = the announced object is the activity, false = we announce the object link
@@ -2509,15 +2501,14 @@ class Transmitter
         * Prepends mentions (@) to $body variable
         *
         * @param string $body HTML code
-        * @param int    $uriId
         * @param string $authorLink Author link
         * @return string HTML code with prepended mentions
         */
-       private static function prependMentions(string $body, int $uriid, string $authorLink): string
+       private static function prependMentions(string $body, int $uriId, string $authorLink): string
        {
                $mentions = [];
 
-               foreach (Tag::getByURIId($uriid, [Tag::IMPLICIT_MENTION]) as $tag) {
+               foreach (Tag::getByURIId($uriId, [Tag::IMPLICIT_MENTION]) as $tag) {
                        $profile = Contact::getByURL($tag['url'], false, ['addr', 'contact-type', 'nick']);
                        if (
                                !empty($profile['addr'])
index 8ea8dfd37aff148c858a01dc4962bfac82bf5e05..93b0d7f9ba27d8cf6b448d38ac284990b70d5869 100644 (file)
@@ -417,7 +417,7 @@ class DFRN
                                $t_dob = strtotime($bd);
                                $now = strtotime(DateTimeFormat::timezoneNow($tz));
                                if ($t_dob < $now) {
-                                       $bd = $y + 1 . '-' . $tmp_dob . ' 00:00';
+                                       $bd = (int) $y + 1 . '-' . $tmp_dob . ' 00:00';
                                }
                                $birthday = DateTimeFormat::convert($bd, 'UTC', $tz, DateTimeFormat::ATOM);
                        }
index 2e5b7bfdd0582a8dcbb94bac1ff23f2a56a13ef0..b791c2572f53d883e7059a8b2a3765c2220adec7 100644 (file)
@@ -29,6 +29,8 @@ use Friendica\Model\User;
 use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Network\HTTPClient\Client\HttpClientRequest;
 use Friendica\Network\HTTPException;
+use Friendica\Network\HTTPException\InternalServerErrorException;
+use Friendica\Network\HTTPException\NotFoundException;
 use Friendica\Network\Probe;
 use Friendica\Protocol\Delivery;
 use Friendica\Util\Crypto;
@@ -778,7 +780,7 @@ class Diaspora
         * @param WebFingerUri $uri The handle
         *
         * @return string The public key
-        * @throws InternalServerErrorException
+        * @throws NotFoundException
         * @throws \ImagickException
         */
        private static function key(WebFingerUri $uri): string
@@ -786,7 +788,7 @@ class Diaspora
                Logger::info('Fetching diaspora key', ['handle' => $uri->getAddr()]);
                try {
                        return DI::dsprContact()->getByAddr($uri)->pubKey;
-               } catch (HTTPException\NotFoundException | \InvalidArgumentException $e) {
+               } catch (NotFoundException | \InvalidArgumentException $e) {
                        return '';
                }
        }
@@ -813,7 +815,7 @@ class Diaspora
         * @param string       $url    profile url or WebFinger address
         * @param boolean|null $update true = always update, false = never update, null = update when not found or outdated
         * @return boolean
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws InternalServerErrorException
         * @throws \ImagickException
         */
        public static function isSupportedByContactUrl(string $url, ?bool $update = null): bool
@@ -2913,14 +2915,13 @@ class Diaspora
        /**
         * Transmit a message to a target server
         *
-        * @param array  $owner        the array of the item owner
         * @param array  $contact      Target of the communication
         * @param string $envelope     The message that is to be transmitted
         * @param bool   $public_batch Is it a public post?
         * @param string $guid         message guid
         *
         * @return int Result of the transmission
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws InternalServerErrorException
         * @throws \ImagickException
         */
        private static function transmit(array $contact, string $envelope, bool $public_batch, string $guid = ''): int
@@ -3222,7 +3223,7 @@ class Diaspora
        /**
         * Create an event array
         *
-        * @param integer $event_id The id of the event
+        * @param string $event_id The id of the event
         *
         * @return array with event data
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
index 988f96c34aefbb27cb7adf01626739a7b727d002..2811c7ee5d3cb17051eed2a1b0a10691684238fb 100644 (file)
@@ -10,31 +10,31 @@ namespace Friendica\Protocol\Diaspora\Entity;
 use Psr\Http\Message\UriInterface;
 
 /**
- * @property-read $uriId
- * @property-read $url
- * @property-read $guid
- * @property-read $addr
- * @property-read $alias
- * @property-read $nick
- * @property-read $name
- * @property-read $givenName
- * @property-read $familyName
- * @property-read $photo
- * @property-read $photoMedium
- * @property-read $photoSmall
- * @property-read $batch
- * @property-read $notify
- * @property-read $poll
- * @property-read $subscribe
- * @property-read $searchable
- * @property-read $pubKey
- * @property-read $baseurl
- * @property-read $gsid
- * @property-read $created
- * @property-read $updated
- * @property-read $interacting_count
- * @property-read $interacted_count
- * @property-read $post_count
+ * @property-read int $uriId
+ * @property-read UriInterface $url
+ * @property-read string $guid
+ * @property-read string $addr
+ * @property-read UriInterface $alias
+ * @property-read string $nick
+ * @property-read string $name
+ * @property-read string $givenName
+ * @property-read string $familyName
+ * @property-read UriInterface $photo
+ * @property-read UriInterface $photoMedium
+ * @property-read UriInterface $photoSmall
+ * @property-read UriInterface $batch
+ * @property-read UriInterface $notify
+ * @property-read UriInterface $poll
+ * @property-read string $subscribe
+ * @property-read bool $searchable
+ * @property-read string $pubKey
+ * @property-read UriInterface $baseurl
+ * @property-read int $gsid
+ * @property-read \DateTime $created
+ * @property-read \DateTime $updated
+ * @property-read int $interacting_count
+ * @property-read int $interacted_count
+ * @property-read int $post_count
  */
 class DiasporaContact extends \Friendica\BaseEntity
 {
index 8de645cb5230bffb22944b729eb18224fcc6d559..b680fedea1fbf4542dfff863abd023cfbfe2d4ca 100644 (file)
@@ -266,7 +266,7 @@ class DiasporaContact extends BaseRepository
        /**
         * get a url (scheme://domain.tld/u/user) from a given contact guid
         *
-        * @param mixed $guid Hexadecimal string guid
+        * @param string $guid Hexadecimal string guid
         *
         * @return string the contact url or null
         * @throws \Exception
index 765a474773d5b5ba8be15c1ed2f31d8d1c75029e..e44c9a70853c71a6f762984f8d7049aa9f412855 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Content\Text\HTML;
 use Friendica\Core\Protocol;
 use Friendica\Model\Item;
 use Friendica\Util\Strings;
-use \IMAP\Connection;
+use IMAP\Connection;
 
 /**
  * Email class
@@ -25,7 +25,7 @@ class Email
         * @param string $mailbox  The mailbox name
         * @param string $username The username
         * @param string $password The password
-        * @return Connection|false
+        * @return Connection|resource|false
         * @throws \Exception
         */
        public static function connect(string $mailbox, string $username, string $password)
@@ -55,7 +55,6 @@ class Email
        /**
         * @param Connection|resource $mbox       mailbox
         * @param string              $email_addr email
-        * @return array
         * @throws \Exception
         */
        public static function poll($mbox, string $email_addr): array