From 7abdc17711c9fa867a0dc93a57b56d6785b4a2c2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 7 Dec 2024 15:21:21 +0000 Subject: [PATCH] Fix errors in Util namespace --- src/Object/EMail/IEmail.php | 1 - src/Util/BasePath.php | 4 ++-- src/Util/Emailer.php | 8 ++++---- src/Util/HTTPSignature.php | 1 - src/Util/Images.php | 4 ++-- src/Util/LDSignature.php | 2 +- src/Util/XML.php | 8 ++++---- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/Object/EMail/IEmail.php b/src/Object/EMail/IEmail.php index b7f7f11274..fa054a856f 100644 --- a/src/Object/EMail/IEmail.php +++ b/src/Object/EMail/IEmail.php @@ -7,7 +7,6 @@ namespace Friendica\Object\EMail; -use Friendica\Util\Emailer; use JsonSerializable; /** diff --git a/src/Util/BasePath.php b/src/Util/BasePath.php index 9cf9330301..e886eeda30 100644 --- a/src/Util/BasePath.php +++ b/src/Util/BasePath.php @@ -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 = []) { diff --git a/src/Util/Emailer.php b/src/Util/Emailer.php index 47aa63c4ee..0dc9f48f09 100644 --- a/src/Util/Emailer.php +++ b/src/Util/Emailer.php @@ -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; } diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index de775a17ec..5f668255ca 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -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 diff --git a/src/Util/Images.php b/src/Util/Images.php index 62e22ef2f8..8eadaf4025 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -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 diff --git a/src/Util/LDSignature.php b/src/Util/LDSignature.php index 270ee8b74b..9d0c08d33b 100644 --- a/src/Util/LDSignature.php +++ b/src/Util/LDSignature.php @@ -119,7 +119,7 @@ class LDSignature /** * Hashes normalized object * - * @param ??? $obj + * @param array $obj * @return string SHA256 hash */ private static function hash($obj): string diff --git a/src/Util/XML.php b/src/Util/XML.php index 3b9c904414..52a1d9f3bf 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -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) {