]> git.mxchange.org Git - friendica.git/commitdiff
Fix errors in Util namespace
authorArt4 <art4@wlabs.de>
Sat, 7 Dec 2024 15:21:21 +0000 (15:21 +0000)
committerArt4 <art4@wlabs.de>
Sat, 7 Dec 2024 15:21:21 +0000 (15:21 +0000)
src/Object/EMail/IEmail.php
src/Util/BasePath.php
src/Util/Emailer.php
src/Util/HTTPSignature.php
src/Util/Images.php
src/Util/LDSignature.php
src/Util/XML.php

index b7f7f112740666d4ddc70f8e6158233f8da6b943..fa054a856fb526ebdee1674963fef070035a2f58 100644 (file)
@@ -7,7 +7,6 @@
 
 namespace Friendica\Object\EMail;
 
-use Friendica\Util\Emailer;
 use JsonSerializable;
 
 /**
index 9cf933030188049e31c65a3dc1903c07b271676c..e886eeda3039dc232ce64bd34a34423ba4c53ad7 100644 (file)
@@ -19,8 +19,8 @@ class BasePath
        private $server;
 
        /**
-        * @param string|null $baseDir The default base path
-        * @param array       $server  server arguments
+        * @param string $baseDir The default base path
+        * @param array  $server  server arguments
         */
        public function __construct(string $baseDir, array $server = [])
        {
index 47aa63c4ee0e354c06db08e02059855242cbbdb0..0dc9f48f09c1ecc5a31578da4cb58f888a7fe156 100644 (file)
@@ -7,7 +7,7 @@
 
 namespace Friendica\Util;
 
-use Friendica\App;
+use Friendica\App\BaseURL;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
@@ -30,7 +30,7 @@ class Emailer
        private $pConfig;
        /** @var LoggerInterface */
        private $logger;
-       /** @var App\BaseURL */
+       /** @var BaseURL */
        private $baseUrl;
        /** @var L10n */
        private $l10n;
@@ -40,7 +40,7 @@ class Emailer
        /** @var string */
        private $siteEmailName;
 
-       public function __construct(IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\BaseURL $baseURL, LoggerInterface $logger,
+       public function __construct(IManageConfigValues $config, IManagePersonalConfigValues $pConfig, BaseURL $baseURL, LoggerInterface $logger,
                                    L10n $defaultLang)
        {
                $this->config      = $config;
@@ -116,7 +116,7 @@ class Emailer
        {
                Hook::callAll('emailer_send_prepare', $email);
 
-               if (empty($email)) {
+               if (! $email instanceof IEmail) {
                        return true;
                }
 
index de775a17ec385f08dae46cc2ab22025b3770332b..5f668255caac745f763a63401f5e1c6379ad9272 100644 (file)
@@ -520,7 +520,6 @@ class HTTPSignature
         *
         * @param string  $request request url
         * @param integer $uid     User id of the requester
-        * @param boolean $binary  TRUE if asked to return binary results (file download) (default is "false")
         * @param array   $opts    (optional parameters) associative array with:
         *                         'accept_content' => supply Accept: header with 'accept_content' as the value
         *                         'timeout' => int Timeout in seconds, default system config value or 60 seconds
index 62e22ef2f86234362ca8b3e53712bd4b43cb504b..8eadaf402539deb0ae6ac9865d66d184f5ffdd42 100644 (file)
@@ -189,9 +189,9 @@ class Images
         * Fetch image mimetype from the image data or guessing from the file name
         *
         * @param string $image_data Image data
-        * @param string $filename   File name (for guessing the type via the extension)
-        * @param string $default    Default MIME type
+        *
         * @return string MIME type
+        *
         * @throws \Exception
         */
        public static function getMimeTypeByData(string $image_data): string
index 270ee8b74b5b20aeb73387bb1c9b64ce1033e458..9d0c08d33b06e9cf03a7fffe18ce9bdcf797aa10 100644 (file)
@@ -119,7 +119,7 @@ class LDSignature
        /**
         * Hashes normalized object
         *
-        * @param ??? $obj
+        * @param array $obj
         * @return string SHA256 hash
         */
        private static function hash($obj): string
index 3b9c9044143abdc0b8ddb06d83c77dfa3cbad15b..52a1d9f3bf3456cbee6acf3e972e1b8583050197 100644 (file)
@@ -122,9 +122,9 @@ class XML
        /**
         * Copies an XML object
         *
-        * @param object|string $source      The XML source
-        * @param object        $target      The XML target
-        * @param string        $elementname Name of the XML element of the target
+        * @param object $source      The XML source
+        * @param object $target      The XML target
+        * @param string $elementname Name of the XML element of the target
         * @return void
         */
        public static function copy(&$source, &$target, $elementname)
@@ -476,7 +476,7 @@ class XML
         * @param DOMXPath $xpath XPath object
         * @param string $element Element name
         * @param DOMNode $context Context object or NULL
-        * @return ???|bool First element's attributes field or false on failure
+        * @return mixed|bool First element's attributes field or false on failure
         */
        public static function getFirstAttributes(DOMXPath $xpath, string $element, DOMNode $context = null)
        {