]> git.mxchange.org Git - friendica.git/commitdiff
Fix errors in Content namespace
authorArt4 <art4@wlabs.de>
Sun, 1 Dec 2024 22:53:53 +0000 (22:53 +0000)
committerArt4 <art4@wlabs.de>
Sun, 1 Dec 2024 22:53:53 +0000 (22:53 +0000)
src/Content/ContactSelector.php
src/Content/Conversation.php
src/Content/Image.php
src/Content/Item.php
src/Content/OEmbed.php
src/Content/Post/Entity/PostMedia.php
src/Content/Text/BBCode.php
src/Content/Text/HTML.php

index 4e75ea34d12eeed12b7003cf5e238292c7d73ef9..1bd891a8441202584e0d1927d1607d9e88bed3e0 100644 (file)
@@ -106,10 +106,9 @@ class ContactSelector
         * Determines network name
         *
         * @param string $network  network of the contact
-        * @param string $profile  optional, default empty
         * @param string $protocol (Optional) Protocol that is used for the transmission
         * @param int $gsid Server id
-        * @return string
+        *
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function networkToName(string $network, string $protocol = '', int $gsid = null): string
index f765e39e319ef80b63ca4cac649d3ccd2cb3c9c1..bef360380953834ab33e6689094904dec803ae65 100644 (file)
@@ -41,6 +41,7 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
+use ImagickException;
 use Psr\Log\LoggerInterface;
 
 class Conversation
@@ -112,7 +113,7 @@ class Conversation
         * @param array &$conv_responses (already created with builtin activity structure)
         * @return void
         * @throws ImagickException
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws InternalServerErrorException
         */
        public function builtinActivityPuller(array $activity, array &$conv_responses)
        {
@@ -598,7 +599,7 @@ class Conversation
         * @param string $formSecurityToken A 'contact_action' form security token
         * @return array
         * @throws InternalServerErrorException
-        * @throws \ImagickException
+        * @throws ImagickException
         */
        public function getThreadList(array $items, string $mode, bool $preview, bool $pagedrop, string $formSecurityToken): array
        {
index 8b84ad4512e62e5a8b27790506c724ba59a4d34a..4e5d025ad86e110eff71654ad27d6cf1e5479c50 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Content\Image\Collection\MasonryImageRow;
 use Friendica\Content\Image\Entity\MasonryImage;
 use Friendica\Content\Post\Collection\PostMedias;
 use Friendica\Core\Renderer;
+use Friendica\Network\HTTPException\ServiceUnavailableException;
 
 class Image
 {
@@ -42,9 +43,7 @@ class Image
        }
 
        /**
-        * @param PostMedias $images
-        * @return string
-        * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
+        * @throws ServiceUnavailableException
         */
        private static function getImageGridHtml(PostMedias $images): string
        {
@@ -70,9 +69,7 @@ class Image
         * For each row, we calculate how much of the total width each picture will take depending on their aspect ratio
         * and how much relative height it needs to accomodate all pictures next to each other with their height normalized.
         *
-        * @param array $images
-        * @return string
-        * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
+        * @throws ServiceUnavailableException
         */
        private static function getHorizontalMasonryHtml(PostMedias $images): string
        {
index 66a3328b04936e8de1520e2c8ecd0f761cb0bf47..7343c06aff514b8d1540c076644a21eb0c3045b4 100644 (file)
@@ -32,6 +32,7 @@ use Friendica\Model\Post;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
 use Friendica\Network\HTTPException;
+use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Object\EMail\ItemCCEMail;
 use Friendica\Protocol\Activity;
 use Friendica\Util\ACLFormatter;
@@ -42,6 +43,7 @@ use Friendica\Util\Profiler;
 use Friendica\Util\Proxy;
 use Friendica\Util\XML;
 use GuzzleHttp\Psr7\Uri;
+use ImagickException;
 
 /**
  * A content helper class for displaying items
@@ -174,8 +176,8 @@ class Item
         * @param string $network     The network of the post
         *
         * @return array|bool ['replaced' => $replaced, 'contact' => $contact] or "false" on if already replaced
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \ImagickException
+        * @throws InternalServerErrorException
+        * @throws ImagickException
         */
        public static function replaceTag(string &$body, int $profile_uid, string $tag, string $network = '')
        {
@@ -275,7 +277,7 @@ class Item
         * @param array $item
         * @return void
         * @throws ImagickException
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws InternalServerErrorException
         */
        public function localize(array &$item)
        {
@@ -645,11 +647,6 @@ class Item
 
        /**
         * Add a share block for the given guid
-        *
-        * @param string $guid
-        * @param integer $uid
-        * @param bool $add_media
-        * @return string
         */
        private function createSharedPostByGuid(string $guid, bool $add_media): string
        {
index e5841ea22e31d736f9476c21797df0eb134b2d6b..599d3dc8f77416678375bc8a0d49c0c9afaf0f04 100644 (file)
@@ -8,6 +8,7 @@
 namespace Friendica\Content;
 
 use DOMDocument;
+use DOMElement;
 use DOMXPath;
 use Exception;
 use Friendica\Content\Text\BBCode;
@@ -83,6 +84,7 @@ class OEmbed
                                                        $xpath->query("//link[@type='application/json+oembed'] | //link[@type='text/json+oembed']")
                                                        as $link)
                                                {
+                                                       /** @var DOMElement $link */
                                                        $href = $link->getAttributeNode('href')->nodeValue;
                                                        // Both Youtube and Vimeo output OEmbed endpoint URL with HTTP
                                                        // but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
index 0dd33091763964c7a47983e1cf7978213da16fee..0dbbc54d2edc650ec25681f9f4239b4d2f57e471 100644 (file)
@@ -165,7 +165,7 @@ class PostMedia extends BaseEntity
         * Get preview path for given media id relative to the base URL
         *
         * @param string  $size     One of the Proxy::SIZE_* constants
-        * @param bool     $vlurred If "true", the preview will be blurred
+        * @param bool    $blurred  If "true", the preview will be blurred
         * @return string preview link
         */
        public function getPreviewPath(string $size = '', bool $blurred = false): string
index bcac088e7e71173b1909c09a014addd2465f78de..900032c33ef7970d2e019abc51db29cc9e5184f7 100644 (file)
@@ -824,11 +824,6 @@ class BBCode
 
        /**
         * Convert complex IMG and ZMG elements
-        *
-        * @param [type] $text
-        * @param integer $simplehtml
-        * @param integer $uriid
-        * @return string
         */
        private static function convertImages(string $text, int $simplehtml, int $uriid = 0): string
        {
@@ -1113,7 +1108,7 @@ class BBCode
        /**
         * Removes links
         *
-        * @param string $text HTML/BBCode string
+        * @param string $bbcode HTML/BBCode string
         * @return string Cleaned HTML/BBCode
         */
        public static function removeLinks(string $bbcode): string
index 57b3cc1defbb277e9f4b6341afb09c408dab6be1..ba992e4a8fdada5b52a076c2b2e572475ee5bc70 100644 (file)
@@ -966,7 +966,7 @@ class HTML
 
                $text = $HTMLPurifier->purify($text);
 
-               /** @var \HTMLPurifier_ErrorCollector $errorCollector */
+               ///** @var \HTMLPurifier_ErrorCollector $errorCollector */
                // Uncomment to debug HTML Purifier behavior
                //$errorCollector = $HTMLPurifier->context->get('ErrorCollector');
                //var_dump($errorCollector->getRaw());