diff --git a/.phpstan.neon b/.phpstan.neon index d50f8c0770..fca7f6d59d 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -3,10 +3,10 @@ # SPDX-License-Identifier: CC0-1.0 parameters: - level: 1 + level: 2 paths: - - addon/ + # - addon/ - src/ excludePaths: @@ -23,3 +23,19 @@ parameters: dynamicConstantNames: - DB_UPDATE_VERSION + + ignoreErrors: + - + # Ignore missing GdImage class in PHP <= 7.4 + message: '(^Property .+ has unknown class GdImage as its type\.$)' + path: src + + - + # Ignore missing IMAP\Connection class in PHP <= 8.0 + message: '(^Method .+ has invalid return type IMAP\\Connection\.$)' + path: src + + - + # Ignore missing IMAP\Connection class in PHP <= 8.0 + message: '(^Parameter .+ has invalid type IMAP\\Connection\.$)' + path: src diff --git a/src/BaseEntity.php b/src/BaseEntity.php index 6f61872548..e4028cdfbe 100644 --- a/src/BaseEntity.php +++ b/src/BaseEntity.php @@ -7,7 +7,7 @@ namespace Friendica; -use Friendica\Network\HTTPException; +use Friendica\Network\HTTPException\InternalServerErrorException; /** * The Entity classes directly inheriting from this abstract class are meant to represent a single business entity. @@ -29,12 +29,12 @@ abstract class BaseEntity extends BaseDataTransferObject /** * @param string $name * @return mixed - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public function __get(string $name) { if (!property_exists($this, $name)) { - throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class); + throw new InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class); } return $this->$name; @@ -43,12 +43,12 @@ abstract class BaseEntity extends BaseDataTransferObject /** * @param mixed $name * @return bool - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public function __isset($name): bool { if (!property_exists($this, $name)) { - throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class); + throw new InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class); } return !empty($this->$name); diff --git a/src/BaseModel.php b/src/BaseModel.php index d7c4fae708..e79270843f 100644 --- a/src/BaseModel.php +++ b/src/BaseModel.php @@ -15,7 +15,7 @@ use Psr\Log\LoggerInterface; * The Model classes inheriting from this abstract class are meant to represent a single database record. * The associated table name has to be provided in the child class, and the table is expected to have a unique `id` field. * - * @property int id + * @property int $id */ abstract class BaseModel extends BaseDataTransferObject { @@ -41,8 +41,6 @@ abstract class BaseModel extends BaseDataTransferObject private $originalData = []; /** - * @param Database $dba - * @param LoggerInterface $logger * @param array $data Table row attributes */ public function __construct(Database $dba, LoggerInterface $logger, array $data = []) diff --git a/src/Collection/Api/Mastodon/Fields.php b/src/Collection/Api/Mastodon/Fields.php index 4225b2e0b5..3aba73a349 100644 --- a/src/Collection/Api/Mastodon/Fields.php +++ b/src/Collection/Api/Mastodon/Fields.php @@ -7,8 +7,8 @@ namespace Friendica\Collection\Api\Mastodon; -use Friendica\Api\Entity\Mastodon\Field; use Friendica\BaseCollection; +use Friendica\Object\Api\Mastodon\Field; class Fields extends BaseCollection { diff --git a/src/Console/ClearAvatarCache.php b/src/Console/ClearAvatarCache.php index 82ba8f6660..e80684c354 100644 --- a/src/Console/ClearAvatarCache.php +++ b/src/Console/ClearAvatarCache.php @@ -10,6 +10,7 @@ namespace Friendica\Console; use Friendica\App\BaseURL; use Friendica\Contact\Avatar; use Friendica\Core\L10n; +use Friendica\Database\Database; use Friendica\Model\Contact; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -21,12 +22,12 @@ class ClearAvatarCache extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var $dba Friendica\Database\Database + * @var Database */ private $dba; /** - * @var $baseurl Friendica\App\BaseURL + * @var BaseURL */ private $baseUrl; diff --git a/src/Console/Contact.php b/src/Console/Contact.php index b33baa6efa..8173054826 100644 --- a/src/Console/Contact.php +++ b/src/Console/Contact.php @@ -9,6 +9,7 @@ namespace Friendica\Console; use Console_Table; use Friendica\App\Mode; +use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\DI; use Friendica\Model\Contact as ContactModel; use Friendica\Model\User as UserModel; @@ -29,7 +30,7 @@ class Contact extends \Asika\SimpleConsole\Console */ private $appMode; /** - * @var IPConfig + * @var IManagePersonalConfigValues */ private $pConfig; diff --git a/src/Console/MergeContacts.php b/src/Console/MergeContacts.php index e9930a55d8..54f3fe5142 100644 --- a/src/Console/MergeContacts.php +++ b/src/Console/MergeContacts.php @@ -19,7 +19,7 @@ class MergeContacts extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var $dba Database + * @var Database */ private $dba; diff --git a/src/Console/MoveToAvatarCache.php b/src/Console/MoveToAvatarCache.php index 90a35630e1..567c82f2b6 100644 --- a/src/Console/MoveToAvatarCache.php +++ b/src/Console/MoveToAvatarCache.php @@ -9,12 +9,13 @@ namespace Friendica\Console; use Friendica\App\BaseURL; use Friendica\Contact\Avatar; +use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; +use Friendica\Core\Protocol; +use Friendica\Database\Database; use Friendica\Model\Contact; use Friendica\Model\Photo; use Friendica\Object\Image; -use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Protocol; /** * tool to move cached avatars to the avatar file cache. @@ -24,12 +25,12 @@ class MoveToAvatarCache extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var $dba Friendica\Database\Database + * @var Database */ private $dba; /** - * @var $baseurl Friendica\App\BaseURL + * @var BaseURL */ private $baseUrl; diff --git a/src/Console/Relay.php b/src/Console/Relay.php index 343cda28e9..3aeaad458f 100644 --- a/src/Console/Relay.php +++ b/src/Console/Relay.php @@ -8,6 +8,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; +use Friendica\Database\Database; use Friendica\Model\APContact; use Friendica\Protocol\ActivityPub\Transmitter; use Friendica\Protocol\Relay as ProtocolRelay; @@ -23,7 +24,7 @@ class Relay extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var $dba Friendica\Database\Database + * @var Database */ private $dba; diff --git a/src/Contact/Avatar.php b/src/Contact/Avatar.php index 66930119e8..7827465b4e 100644 --- a/src/Contact/Avatar.php +++ b/src/Contact/Avatar.php @@ -235,9 +235,6 @@ class Avatar /** * Delete locally cached avatar pictures of a contact - * - * @param string $avatar - * @return bool */ public static function deleteCache(array $contact): bool { diff --git a/src/Contact/FriendSuggest/Entity/FriendSuggest.php b/src/Contact/FriendSuggest/Entity/FriendSuggest.php index f5bb9dd993..67159a9ea0 100644 --- a/src/Contact/FriendSuggest/Entity/FriendSuggest.php +++ b/src/Contact/FriendSuggest/Entity/FriendSuggest.php @@ -19,7 +19,7 @@ use Friendica\BaseEntity; * @property-read string $request * @property-read string $photo * @property-read string $note - * @property-read \DateTime created + * @property-read \DateTime $created * @property-read int|null $id */ class FriendSuggest extends BaseEntity diff --git a/src/Contact/FriendSuggest/Repository/FriendSuggest.php b/src/Contact/FriendSuggest/Repository/FriendSuggest.php index a93c4a2ddb..1b22c7b797 100644 --- a/src/Contact/FriendSuggest/Repository/FriendSuggest.php +++ b/src/Contact/FriendSuggest/Repository/FriendSuggest.php @@ -9,7 +9,7 @@ namespace Friendica\Contact\FriendSuggest\Repository; use Friendica\BaseRepository; use Friendica\Contact\FriendSuggest\Collection; -use Friendica\Contact\FriendSuggest\Entity; +use Friendica\Contact\FriendSuggest\Entity\FriendSuggest as FriendSuggestEntity; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestNotFoundException; use Friendica\Contact\FriendSuggest\Exception\FriendSuggestPersistenceException; use Friendica\Contact\FriendSuggest\Factory; @@ -30,7 +30,7 @@ class FriendSuggest extends BaseRepository parent::__construct($database, $logger, $factory); } - private function convertToTableRow(Entity\FriendSuggest $fsuggest): array + private function convertToTableRow(FriendSuggestEntity $fsuggest): array { return [ 'uid' => $fsuggest->uid, @@ -45,14 +45,9 @@ class FriendSuggest extends BaseRepository } /** - * @param array $condition - * @param array $params - * - * @return Entity\FriendSuggest - * * @throws NotFoundException The underlying exception if there's no FriendSuggest with the given conditions */ - private function selectOne(array $condition, array $params = []): Entity\FriendSuggest + private function selectOne(array $condition, array $params = []): FriendSuggestEntity { return parent::_selectOne($condition, $params); } @@ -71,13 +66,9 @@ class FriendSuggest extends BaseRepository } /** - * @param int $id - * - * @return Entity\FriendSuggest - * * @throws FriendSuggestNotFoundException in case there's no suggestion for this id */ - public function selectOneById(int $id): Entity\FriendSuggest + public function selectOneById(int $id): FriendSuggestEntity { try { return $this->selectOne(['id' => $id]); @@ -103,13 +94,9 @@ class FriendSuggest extends BaseRepository } /** - * @param Entity\FriendSuggest $fsuggest - * - * @return Entity\FriendSuggest - * * @throws FriendSuggestNotFoundException in case the underlying storage cannot save the suggestion */ - public function save(Entity\FriendSuggest $fsuggest): Entity\FriendSuggest + public function save(FriendSuggestEntity $fsuggest): FriendSuggestEntity { try { $fields = $this->convertToTableRow($fsuggest); diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 4e75ea34d1..1bd891a844 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -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 diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index f765e39e31..bef3603809 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -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 { diff --git a/src/Content/Image.php b/src/Content/Image.php index 8b84ad4512..4e5d025ad8 100644 --- a/src/Content/Image.php +++ b/src/Content/Image.php @@ -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 { diff --git a/src/Content/Item.php b/src/Content/Item.php index 66a3328b04..7343c06aff 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -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 { diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index e5841ea22e..599d3dc8f7 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -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 ¯\_(ツ)_/¯ diff --git a/src/Content/Post/Entity/PostMedia.php b/src/Content/Post/Entity/PostMedia.php index 0dd3309176..4b4268b750 100644 --- a/src/Content/Post/Entity/PostMedia.php +++ b/src/Content/Post/Entity/PostMedia.php @@ -164,17 +164,17 @@ 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 string $size One of the Proxy::SIZE_* constants + * @param bool $blur If "true", the preview will be blurred * @return string preview link */ - public function getPreviewPath(string $size = '', bool $blurred = false): string + public function getPreviewPath(string $size = '', bool $blur = false): string { $path = '/photo/preview/' . (Proxy::getPixelsFromSize($size) ? Proxy::getPixelsFromSize($size) . '/' : '') . $this->id; - if ($blurred) { + if ($blur) { $path .= '?' . http_build_query(['blur' => true]); } return $path; diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index bcac088e7e..900032c33e 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -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 diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 57b3cc1def..ba992e4a8f 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -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()); diff --git a/src/Content/Text/HTMLPurifier_URIScheme_cid.php b/src/Content/Text/HTMLPurifier_URIScheme_cid.php index 8ed03f7c5d..05d7e27722 100644 --- a/src/Content/Text/HTMLPurifier_URIScheme_cid.php +++ b/src/Content/Text/HTMLPurifier_URIScheme_cid.php @@ -7,7 +7,10 @@ namespace Friendica\Content\Text; -use \HTMLPurifier_URIScheme; +use HTMLPurifier_Config; +use HTMLPurifier_Context; +use HTMLPurifier_URI; +use HTMLPurifier_URIScheme; /** * Validates content-id ("cid") as used in multi-part MIME messages, as defined by RFC 2392 diff --git a/src/Core/ACL.php b/src/Core/ACL.php index bfd751c086..e0ff7e9e6a 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -7,6 +7,7 @@ namespace Friendica\Core; +use Exception; use Friendica\App\Page; use Friendica\Database\DBA; use Friendica\DI; diff --git a/src/Core/Cache/Capability/ICanCache.php b/src/Core/Cache/Capability/ICanCache.php index 6360342c5e..0b7dc647c3 100644 --- a/src/Core/Cache/Capability/ICanCache.php +++ b/src/Core/Cache/Capability/ICanCache.php @@ -18,7 +18,7 @@ interface ICanCache /** * Lists all cache keys * - * @param string|null prefix optional a prefix to search + * @param string|null $prefix optional a prefix to search * * @return array Empty if it isn't supported by the cache driver */ diff --git a/src/Core/Config/Model/ConfigTransaction.php b/src/Core/Config/Model/ConfigTransaction.php index f832d93e0c..c3703364a8 100644 --- a/src/Core/Config/Model/ConfigTransaction.php +++ b/src/Core/Config/Model/ConfigTransaction.php @@ -7,7 +7,6 @@ namespace Friendica\Core\Config\Model; -use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\ISetConfigValuesTransactionally; use Friendica\Core\Config\Exception\ConfigPersistenceException; use Friendica\Core\Config\ValueObject\Cache; @@ -17,7 +16,7 @@ use Friendica\Core\Config\ValueObject\Cache; */ class ConfigTransaction implements ISetConfigValuesTransactionally { - /** @var IManageConfigValues */ + /** @var DatabaseConfig */ protected $config; /** @var Cache */ protected $setCache; diff --git a/src/Core/L10n.php b/src/Core/L10n.php index fd70063fb6..79d83950a9 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -345,10 +345,6 @@ class L10n /** * Provide a fallback which will not collide with a function defined in any language file - * - * @param int $n - * - * @return bool */ private function stringPluralSelectDefault(float $n): bool { @@ -426,7 +422,7 @@ class L10n $iso639 = new \Matriphe\ISO639\ISO639; // In ISO 639-2 undetermined languages have got the code "und". - // There is no official code for ISO 639-1, but "un" is not assigned to any language. + // There is no official code for ISO 639-1, but "un" is not assigned to any language. $languages = [self::UNDETERMINED_LANGUAGE => $this->t('Undetermined')]; foreach ($this->getDetectableLanguages() as $code) { diff --git a/src/Core/Lock/Capability/ICanLock.php b/src/Core/Lock/Capability/ICanLock.php index ef7dfcae77..ae15a751ac 100644 --- a/src/Core/Lock/Capability/ICanLock.php +++ b/src/Core/Lock/Capability/ICanLock.php @@ -65,7 +65,7 @@ interface ICanLock /** * Lists all locks * - * @param string prefix optional a prefix to search + * @param string $prefix optional a prefix to search * * @return string[] Empty if it isn't supported by the cache driver * diff --git a/src/Core/Lock/Type/CacheLock.php b/src/Core/Lock/Type/CacheLock.php index 65b07b9bfd..c3794d06a7 100644 --- a/src/Core/Lock/Type/CacheLock.php +++ b/src/Core/Lock/Type/CacheLock.php @@ -16,12 +16,14 @@ use Friendica\Core\Lock\Exception\LockPersistenceException; class CacheLock extends AbstractLock { /** - * @var string The static prefix of all locks inside the cache + * The static prefix of all locks inside the cache + * + * @var string */ const CACHE_PREFIX = 'lock:'; /** - * @var ICanCache; + * @var ICanCacheInMemory */ private $cache; diff --git a/src/Core/Logger.php b/src/Core/Logger.php index ee6e3df86f..48fd1293b3 100644 --- a/src/Core/Logger.php +++ b/src/Core/Logger.php @@ -18,20 +18,24 @@ use Psr\Log\LogLevel; class Logger { /** - * @var LoggerInterface The default Logger type + * LoggerInterface The default Logger type + * + * @var string */ const TYPE_LOGGER = LoggerInterface::class; /** - * @var WorkerLogger A specific worker logger type, which can be enabled + * WorkerLogger A specific worker logger type, which can be enabled + * + * @var string */ const TYPE_WORKER = WorkerLogger::class; /** - * @var LoggerInterface The current logger type + * @var string $type LoggerInterface The current logger type */ private static $type = self::TYPE_LOGGER; /** - * @return LoggerInterface + * @return LoggerInterface|WorkerLogger */ private static function getInstance() { @@ -52,7 +56,7 @@ class Logger public static function enableWorker(string $functionName) { self::$type = self::TYPE_WORKER; - self::getInstance()->setFunctionName($functionName); + DI::workerLogger()->setFunctionName($functionName); } /** diff --git a/src/Core/Logger/Type/StreamLogger.php b/src/Core/Logger/Type/StreamLogger.php index 670181c33a..81af7e4474 100644 --- a/src/Core/Logger/Type/StreamLogger.php +++ b/src/Core/Logger/Type/StreamLogger.php @@ -55,7 +55,7 @@ class StreamLogger extends AbstractLogger /** * {@inheritdoc} - * @param string $level The minimum loglevel at which this logger will be triggered + * @param int $logLevel The minimum loglevel at which this logger will be triggered * * @throws LoggerException */ diff --git a/src/Core/Logger/Util/LoggerSettingsCheck.php b/src/Core/Logger/Util/LoggerSettingsCheck.php index a62254c048..835ba0e610 100644 --- a/src/Core/Logger/Util/LoggerSettingsCheck.php +++ b/src/Core/Logger/Util/LoggerSettingsCheck.php @@ -17,7 +17,7 @@ class LoggerSettingsCheck implements ICheckLoggerSettings { /** @var IManageConfigValues */ protected $config; - /** @var $fileSystem */ + /** @var FileSystem */ protected $fileSystem; /** @var L10n */ protected $l10n; @@ -38,10 +38,8 @@ class LoggerSettingsCheck implements ICheckLoggerSettings try { $stream = $this->fileSystem->createStream($file); - - if (!isset($stream)) { - throw new LoggerUnusableException('Stream is null.'); - } + } catch (LoggerUnusableException $exception) { + throw new LoggerUnusableException('Stream is null.', $exception); } catch (\Throwable $exception) { return $this->l10n->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage()); } @@ -57,16 +55,14 @@ class LoggerSettingsCheck implements ICheckLoggerSettings if ($this->config->get('system', 'debugging')) { $file = $this->config->get('system', 'dlogfile'); - if (empty($file)) { + if ($file === null || $file === '') { return null; } try { $stream = $this->fileSystem->createStream($file); - - if (!isset($stream)) { - throw new LoggerUnusableException('Stream is null.'); - } + } catch (LoggerUnusableException $exception) { + throw new LoggerUnusableException('Stream is null.', $exception); } catch (\Throwable $exception) { return $this->l10n->t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage()); } diff --git a/src/Core/Storage/Repository/StorageManager.php b/src/Core/Storage/Repository/StorageManager.php index 3ab2022059..47b3bcca55 100644 --- a/src/Core/Storage/Repository/StorageManager.php +++ b/src/Core/Storage/Repository/StorageManager.php @@ -274,24 +274,24 @@ class StorageManager */ public function register(string $class): bool { - if (is_subclass_of($class, ICanReadFromStorage::class)) { - /** @var ICanReadFromStorage $class */ - if ($this->isValidBackend($class::getName(), $this->validBackends)) { - return true; - } - - $backends = $this->validBackends; - $backends[] = $class::getName(); - - if ($this->config->set('storage', 'backends', $backends)) { - $this->validBackends = $backends; - return true; - } else { - return false; - } - } else { + if (!is_subclass_of($class, ICanReadFromStorage::class)) { return false; } + + /** @var class-string $class */ + if ($this->isValidBackend($class::getName(), $this->validBackends)) { + return true; + } + + $backends = $this->validBackends; + $backends[] = $class::getName(); + + if ($this->config->set('storage', 'backends', $backends)) { + $this->validBackends = $backends; + return true; + } + + return false; } /** @@ -305,30 +305,31 @@ class StorageManager */ public function unregister(string $class): bool { - if (is_subclass_of($class, ICanReadFromStorage::class)) { - /** @var ICanReadFromStorage $class */ - if ($this->currentBackend::getName() == $class::getName()) { - throw new StorageException(sprintf('Cannot unregister %s, because it\'s currently active.', $class::getName())); - } - - $key = array_search($class::getName(), $this->validBackends); - - if ($key !== false) { - $backends = $this->validBackends; - unset($backends[$key]); - $backends = array_values($backends); - if ($this->config->set('storage', 'backends', $backends)) { - $this->validBackends = $backends; - return true; - } else { - return false; - } - } else { - return true; - } - } else { + if (!is_subclass_of($class, ICanReadFromStorage::class)) { return false; } + + /** @var class-string $class */ + if ($this->currentBackend::getName() == $class::getName()) { + throw new StorageException(sprintf('Cannot unregister %s, because it\'s currently active.', $class::getName())); + } + + $key = array_search($class::getName(), $this->validBackends); + + if ($key === false) { + return true; + } + + $backends = $this->validBackends; + unset($backends[$key]); + $backends = array_values($backends); + + if ($this->config->set('storage', 'backends', $backends)) { + $this->validBackends = $backends; + return true; + } + + return false; } /** diff --git a/src/Core/System.php b/src/Core/System.php index 3eabf9695d..95a411f3d1 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -8,10 +8,8 @@ namespace Friendica\Core; use Friendica\Content\Text\BBCode; -use Friendica\Content\Text\HTML; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\DI; -use Friendica\Model\User; use Friendica\Module\Response; use Friendica\Network\HTTPException\FoundException; use Friendica\Network\HTTPException\InternalServerErrorException; @@ -325,9 +323,9 @@ class System /** * Send HTTP status header and exit. * - * @param integer $val HTTP status result value - * @param string $message Error message. Optional. - * @param string $content Response body. Optional. + * @param integer $httpCode HTTP status result value + * @param string $message Error message. Optional. + * @param string $content Response body. Optional. * @throws \Exception * @deprecated since 2023.09 Use BaseModule->httpError instead */ diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 5d33dc57fe..74ca11f098 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -824,7 +824,11 @@ class Worker $max_idletime = DI::config()->get('system', 'worker_max_idletime'); $last_check = DI::cache()->get(self::LAST_CHECK); $last_date = $last_check ? date('c', $last_check) : ''; - if (($max_idletime > 0) && (time() > $last_check + $max_idletime) && !DBA::exists('workerqueue', ["`done` AND `executed` > ?", DateTimeFormat::utc('now - ' . $max_idletime . ' second')])) { + if ( + ($max_idletime > 0) + && (time() > (int) $last_check + (int) $max_idletime) + && !DBA::exists('workerqueue', ["`done` AND `executed` > ?", DateTimeFormat::utc('now - ' . $max_idletime . ' second')]) + ) { DI::cache()->set(self::LAST_CHECK, time(), Duration::HOUR); Logger::info('The last worker execution had been too long ago.', ['last' => $last_check, 'last-check' => $last_date, 'seconds' => $max_idletime, 'load' => $load, 'max_load' => $maxsysload, 'active_worker' => $active, 'max_worker' => $maxqueues]); return false; @@ -1211,7 +1215,7 @@ class Worker /** * Adds tasks to the worker queue * - * @param (integer|array) priority or parameter array, strings are deprecated and are ignored + * @param integer|array $args priority or parameter array, strings are deprecated and are ignored * * next args are passed as $cmd command line * or: Worker::add(Worker::PRIORITY_HIGH, 'Notifier', Delivery::DELETION, $drop_id); diff --git a/src/Core/Worker/Repository/Process.php b/src/Core/Worker/Repository/Process.php index 058257ffeb..146854234e 100644 --- a/src/Core/Worker/Repository/Process.php +++ b/src/Core/Worker/Repository/Process.php @@ -81,7 +81,7 @@ class Process extends BaseRepository 'pid' => $process->pid, 'hostname' => $this->currentHost, ])) { - throw new ProcessPersistenceException(sprintf('The process with PID %s doesn\'t exists.', $process->pi)); + throw new ProcessPersistenceException(sprintf('The process with PID %d doesn\'t exists.', $process->pid)); } } catch (\Exception $exception) { throw new ProcessPersistenceException(sprintf('Cannot delete process with PID %s.', $process->pid), $exception); diff --git a/src/DI.php b/src/DI.php index 0d03a8239d..de80da34d3 100644 --- a/src/DI.php +++ b/src/DI.php @@ -164,7 +164,7 @@ abstract class DI } /** - * @return AtProtocol\Arguments + * @return ATProtocol\Actor */ public static function atpActor() { @@ -341,7 +341,7 @@ abstract class DI } /** - * @return LoggerInterface + * @return \Friendica\Core\Logger\Type\WorkerLogger */ public static function workerLogger() { @@ -554,7 +554,7 @@ abstract class DI // /** - * @return Contact\FriendSuggest\Repository\FriendSuggest; + * @return Contact\FriendSuggest\Repository\FriendSuggest */ public static function fsuggest() { @@ -562,7 +562,7 @@ abstract class DI } /** - * @return Contact\FriendSuggest\Factory\FriendSuggest; + * @return Contact\FriendSuggest\Factory\FriendSuggest */ public static function fsuggestFactory() { diff --git a/src/Database/DBA.php b/src/Database/DBA.php index a357bd11d7..c001384f99 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -233,7 +233,7 @@ class DBA /** * Returns the number of columns of a statement * - * @param object Statement object + * @param object $stmt Statement object * @return int Number of columns */ public static function columnCount($stmt): int @@ -243,7 +243,7 @@ class DBA /** * Returns the number of rows of a statement * - * @param PDOStatement|mysqli_result|mysqli_stmt Statement object + * @param PDOStatement|mysqli_result|mysqli_stmt $stmt Statement object * @return int Number of rows */ public static function numRows($stmt): int @@ -364,9 +364,9 @@ class DBA * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(string $table, array $conditions, array $options = []): bool + public static function delete(string $table, array $conditions): bool { - return DI::dba()->delete($table, $conditions, $options); + return DI::dba()->delete($table, $conditions); } /** @@ -756,7 +756,7 @@ class DBA /** * Returns the error number of the last query * - * @return string Error number (0 if no error) + * @return int Error number (0 if no error) */ public static function errorNo(): int { @@ -813,8 +813,8 @@ class DBA /** * Acquire a lock to prevent a table optimization * - * @return bool - * @throws LockPersistenceException + * @return bool + * @throws LockPersistenceException */ public static function acquireOptimizeLock(): bool { @@ -823,8 +823,8 @@ class DBA /** * Release the table optimization lock - * @return bool - * @throws LockPersistenceException + * @return bool + * @throws LockPersistenceException */ public static function releaseOptimizeLock(): bool { diff --git a/src/Database/Database.php b/src/Database/Database.php index 15bb84765a..6ee4394901 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -552,8 +552,10 @@ class Database break; } - /** @var $stmt mysqli_stmt|PDOStatement */ - if (!$stmt = $this->connection->prepare($sql)) { + /** @var mysqli_stmt|PDOStatement $stmt */ + $stmt = $this->connection->prepare($sql); + + if (!$stmt) { $errorInfo = $this->connection->errorInfo(); $this->error = (string)$errorInfo[2]; $this->errorno = (int)$errorInfo[1]; @@ -889,7 +891,7 @@ class Database /** * Returns the number of columns of a statement * - * @param object Statement object + * @param object $stmt Statement object * * @return int Number of columns */ @@ -910,7 +912,7 @@ class Database /** * Returns the number of rows of a statement * - * @param PDOStatement|mysqli_result|mysqli_stmt Statement object + * @param PDOStatement|mysqli_result|mysqli_stmt $stmt Statement object * * @return int Number of rows */ @@ -1652,7 +1654,7 @@ class Database /** * Returns the error number of the last query * - * @return string Error number (0 if no error) + * @return int Error number (0 if no error) */ public function errorNo(): int { diff --git a/src/Factory/Api/Mastodon/Card.php b/src/Factory/Api/Mastodon/Card.php index 1a517dea20..32388b4776 100644 --- a/src/Factory/Api/Mastodon/Card.php +++ b/src/Factory/Api/Mastodon/Card.php @@ -8,10 +8,8 @@ namespace Friendica\Factory\Api\Mastodon; use Friendica\BaseFactory; -use Friendica\Content\Text\BBCode; use Friendica\Model\Post; use Friendica\Network\HTTPException; -use Friendica\Util\Strings; class Card extends BaseFactory { @@ -21,7 +19,8 @@ class Card extends BaseFactory * * @return \Friendica\Object\Api\Mastodon\Card * @throws HTTPException\InternalServerErrorException - * @throws \ImagickException*@throws \Exception + * @throws \ImagickException + * @throws \Exception */ public function createFromUriId(int $uriId, array $history = []): \Friendica\Object\Api\Mastodon\Card { diff --git a/src/Factory/Api/Mastodon/Notification.php b/src/Factory/Api/Mastodon/Notification.php index 452cc18cea..4b78a90b8a 100644 --- a/src/Factory/Api/Mastodon/Notification.php +++ b/src/Factory/Api/Mastodon/Notification.php @@ -9,7 +9,7 @@ namespace Friendica\Factory\Api\Mastodon; use Friendica\BaseFactory; use Friendica\Model\Contact; -use Friendica\Navigation\Notifications; +use Friendica\Navigation\Notifications\Entity\Notification as NotificationEntity; use Friendica\Navigation\Notifications\Exception\UnexpectedNotificationTypeException; use Friendica\Object\Api\Mastodon\Notification as MstdnNotification; use Friendica\Protocol\Activity; @@ -32,16 +32,17 @@ class Notification extends BaseFactory } /** - * @param Notifications\Entity\Notification $Notification - * @param bool $display_quote Display quoted posts + * @param NotificationEntity $Notification + * @param bool $display_quotes Display quoted posts * * @return MstdnNotification * @throws UnexpectedNotificationTypeException */ - public function createFromNotification(Notifications\Entity\Notification $Notification, bool $display_quotes): MstdnNotification + public function createFromNotification(NotificationEntity $Notification, bool $display_quotes): MstdnNotification { $type = self::getType($Notification); - if (empty($type)) { + + if ($type === '') { throw new UnexpectedNotificationTypeException(); } diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 3e55b427b5..8cf9f3d8e7 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -20,7 +20,8 @@ use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Verb; -use Friendica\Network\HTTPException; +use Friendica\Network\HTTPException\InternalServerErrorException; +use Friendica\Network\HTTPException\NotFoundException; use Friendica\Object\Api\Mastodon\Status\FriendicaDeliveryData; use Friendica\Object\Api\Mastodon\Status\FriendicaExtension; use Friendica\Object\Api\Mastodon\Status\FriendicaVisibility; @@ -87,8 +88,8 @@ class Status extends BaseFactory * @param bool $in_reply_status Add an "in_reply_status" element * * @return \Friendica\Object\Api\Mastodon\Status - * @throws HTTPException\InternalServerErrorException - * @throws ImagickException|HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws ImagickException|NotFoundException */ public function createFromUriId(int $uriId, int $uid = 0, bool $display_quote = false, bool $reblog = true, bool $in_reply_status = true): \Friendica\Object\Api\Mastodon\Status { @@ -101,7 +102,7 @@ class Status extends BaseFactory if ($mail) { return $this->createFromMailId($mail['id']); } - throw new HTTPException\NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); + throw new NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); } $activity_fields = ['uri-id', 'thr-parent-id', 'uri', 'author-id', 'author-uri-id', 'author-link', 'app', 'created', 'network', 'parent-author-id', 'private']; @@ -113,7 +114,7 @@ class Status extends BaseFactory $activity = $item; $item = Post::selectFirst($fields, ['uri-id' => $uriId, 'uid' => [0, $uid]], ['order' => ['uid' => true]]); if (!$item) { - throw new HTTPException\NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); + throw new NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); } foreach ($activity_fields as $field) { $item[$field] = $activity[$field]; @@ -202,7 +203,7 @@ class Status extends BaseFactory $sensitive = (bool)$item['sensitive']; $network = ContactSelector::networkToName($item['network']); - $sitename = ''; + $sitename = ''; $platform = ''; $version = ''; @@ -211,7 +212,7 @@ class Status extends BaseFactory if (!empty($gserver)) { $platform = ucfirst($gserver['platform']); $version = $gserver['version']; - $sitename = $gserver['site_name']; + $sitename = $gserver['site_name']; } } @@ -370,17 +371,17 @@ class Status extends BaseFactory } /** - * @param int $uriId id of the mail + * @param int $id id of the mail * * @return \Friendica\Object\Api\Mastodon\Status - * @throws HTTPException\InternalServerErrorException - * @throws ImagickException|HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws ImagickException|NotFoundException */ public function createFromMailId(int $id): \Friendica\Object\Api\Mastodon\Status { $item = ActivityPub\Transmitter::getItemArrayFromMail($id, true); if (empty($item)) { - throw new HTTPException\NotFoundException('Mail record not found with id: ' . $id); + throw new NotFoundException('Mail record not found with id: ' . $id); } $account = $this->mstdnAccountFactory->createFromContactId($item['author-id']); diff --git a/src/Factory/Api/Mastodon/StatusSource.php b/src/Factory/Api/Mastodon/StatusSource.php index b0d2511156..67a0526bee 100644 --- a/src/Factory/Api/Mastodon/StatusSource.php +++ b/src/Factory/Api/Mastodon/StatusSource.php @@ -20,7 +20,8 @@ class StatusSource extends BaseFactory * * @return \Friendica\Object\Api\Mastodon\StatusSource * @throws HTTPException\InternalServerErrorException - * @throws \ImagickException*@throws \Exception + * @throws \ImagickException + * @throws \Exception */ public function createFromUriId(int $uriId, int $uid): \Friendica\Object\Api\Mastodon\StatusSource { diff --git a/src/Factory/Api/Mastodon/Subscription.php b/src/Factory/Api/Mastodon/Subscription.php index 61d71850e3..b0aa56f964 100644 --- a/src/Factory/Api/Mastodon/Subscription.php +++ b/src/Factory/Api/Mastodon/Subscription.php @@ -10,18 +10,17 @@ namespace Friendica\Factory\Api\Mastodon; use Friendica\BaseFactory; use Friendica\Database\DBA; use Friendica\Model\Subscription as ModelSubscription; +use Friendica\Object\Api\Mastodon\Subscription as SubscriptionObject; class Subscription extends BaseFactory { /** * @param int $applicationid Application Id * @param int $uid Item user - * - * @return \Friendica\Object\Api\Mastodon\Status */ - public function createForApplicationIdAndUserId(int $applicationid, int $uid): \Friendica\Object\Api\Mastodon\Subscription + public function createForApplicationIdAndUserId(int $applicationid, int $uid): SubscriptionObject { $subscription = DBA::selectFirst('subscription', [], ['application-id' => $applicationid, 'uid' => $uid]); - return new \Friendica\Object\Api\Mastodon\Subscription($subscription, ModelSubscription::getPublicVapidKey()); + return new SubscriptionObject($subscription, ModelSubscription::getPublicVapidKey()); } } diff --git a/src/Factory/Api/Twitter/Status.php b/src/Factory/Api/Twitter/Status.php index 084156b382..b31a89fc44 100644 --- a/src/Factory/Api/Twitter/Status.php +++ b/src/Factory/Api/Twitter/Status.php @@ -17,7 +17,8 @@ use Friendica\Factory\Api\Twitter\User as TwitterUser; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Verb; -use Friendica\Network\HTTPException; +use Friendica\Network\HTTPException\InternalServerErrorException; +use Friendica\Network\HTTPException\NotFoundException; use Friendica\Protocol\Activity; use ImagickException; use Psr\Log\LoggerInterface; @@ -58,13 +59,13 @@ class Status extends BaseFactory } /** - * @param int $uriId Uri-ID of the item + * @param int $id Uri-ID of the item * @param int $uid Item user * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status - * @throws HTTPException\InternalServerErrorException - * @throws ImagickException|HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws ImagickException|NotFoundException */ public function createFromItemId(int $id, int $uid, bool $include_entities = false): \Friendica\Object\Api\Twitter\Status { @@ -73,7 +74,7 @@ class Status extends BaseFactory 'thr-parent-id', 'parent-author-id', 'parent-author-nick', 'uri', 'plink', 'private', 'vid', 'coord', 'quote-uri-id']; $item = Post::selectFirst($fields, ['id' => $id], ['order' => ['uid' => true]]); if (!$item) { - throw new HTTPException\NotFoundException('Item with ID ' . $id . ' not found.'); + throw new NotFoundException('Item with ID ' . $id . ' not found.'); } return $this->createFromArray($item, $uid, $include_entities); } @@ -84,8 +85,8 @@ class Status extends BaseFactory * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status - * @throws HTTPException\InternalServerErrorException - * @throws ImagickException|HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws ImagickException|NotFoundException */ public function createFromUriId(int $uriId, int $uid = 0, bool $include_entities = false): \Friendica\Object\Api\Twitter\Status { @@ -94,7 +95,7 @@ class Status extends BaseFactory 'thr-parent-id', 'parent-author-id', 'parent-author-nick', 'uri', 'plink', 'private', 'vid', 'coord']; $item = Post::selectFirst($fields, ['uri-id' => $uriId, 'uid' => [0, $uid]], ['order' => ['uid' => true]]); if (!$item) { - throw new HTTPException\NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); + throw new NotFoundException('Item with URI ID ' . $uriId . ' not found' . ($uid ? ' for user ' . $uid : '.')); } return $this->createFromArray($item, $uid, $include_entities); } @@ -105,8 +106,8 @@ class Status extends BaseFactory * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status - * @throws HTTPException\InternalServerErrorException - * @throws ImagickException|HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws ImagickException|NotFoundException */ private function createFromArray(array $item, int $uid, bool $include_entities): \Friendica\Object\Api\Twitter\Status { @@ -161,8 +162,8 @@ class Status extends BaseFactory if ($include_entities) { $hashtags = $this->hashtag->createFromUriId($item['uri-id'], $text); $medias = $this->media->createFromUriId($item['uri-id'], $text); - $urls = $this->url->createFromUriId($item['uri-id'], $text); - $mentions = $this->mention->createFromUriId($item['uri-id'], $text); + $urls = $this->url->createFromUriId($item['uri-id']); + $mentions = $this->mention->createFromUriId($item['uri-id']); } else { $attachments = $this->attachment->createFromUriId($item['uri-id'], $text); } @@ -176,8 +177,8 @@ class Status extends BaseFactory if ($include_entities) { $hashtags = array_merge($hashtags, $this->hashtag->createFromUriId($shared_uri_id, $text)); $medias = array_merge($medias, $this->media->createFromUriId($shared_uri_id, $text)); - $urls = array_merge($urls, $this->url->createFromUriId($shared_uri_id, $text)); - $mentions = array_merge($mentions, $this->mention->createFromUriId($shared_uri_id, $text)); + $urls = array_merge($urls, $this->url->createFromUriId($shared_uri_id)); + $mentions = array_merge($mentions, $this->mention->createFromUriId($shared_uri_id)); } else { $attachments = array_merge($attachments, $this->attachment->createFromUriId($shared_uri_id, $text)); } diff --git a/src/Model/Attach.php b/src/Model/Attach.php index bd5bd940d0..1fe619f79a 100644 --- a/src/Model/Attach.php +++ b/src/Model/Attach.php @@ -12,11 +12,11 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Core\Storage\Exception\InvalidClassStorageException; use Friendica\Core\Storage\Exception\ReferenceStorageException; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Mimetype; use Friendica\Security\Security; -use Friendica\Util\Network; /** * Class to handle attach database table @@ -183,7 +183,7 @@ class Attach * @param string $deny_gid Permissions, denied circle. optional, default = '' * * @return boolean|integer Row id on success, False on errors - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function store(string $data, int $uid, string $filename, string $filetype = '', int $filesize = null, string $allow_cid = '', string $allow_gid = '', string $deny_cid = '', string $deny_gid = '') { @@ -237,7 +237,7 @@ class Attach * @param string $deny_cid * @param string $deny_gid * @return boolean|int Insert id or false on failure - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function storeFile(string $src, int $uid, string $filename = '', string $filetype = '', string $allow_cid = '', string $allow_gid = '', string $deny_cid = '', string $deny_gid = '') { @@ -257,11 +257,11 @@ class Attach * @param array $fields Contains the fields that are updated * @param array $conditions Condition array with the key values * @param Image $img Image data to update. Optional, default null. - * @param array|boolean $old_fields Array with the old field values that are about to be replaced (true = update on duplicate) + * @param array $old_fields Array with the old field values that are about to be replaced (true = update on duplicate) * * @return boolean Was the update successful? * - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @see \Friendica\Database\DBA::update */ public static function update(array $fields, array $conditions, Image $img = null, array $old_fields = []): bool @@ -287,19 +287,17 @@ class Attach return DBA::update('attach', $fields, $conditions, $old_fields); } - /** * Delete info from table and data from storage * * @param array $conditions Field condition(s) - * @param array $options Options array, Optional * * @return boolean * * @throws \Exception * @see \Friendica\Database\DBA::delete */ - public static function delete(array $conditions, array $options = []): bool + public static function delete(array $conditions): bool { // get items to delete data info $items = self::selectToArray(['backend-class', 'backend-ref'], $conditions); @@ -315,7 +313,7 @@ class Attach } } - return DBA::delete('attach', $conditions, $options); + return DBA::delete('attach', $conditions); } public static function setPermissionFromBody(array $post) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index e007afc2d8..1c3186cf7e 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -7,10 +7,10 @@ namespace Friendica\Model; +use Exception; use Friendica\Contact\Avatar; use Friendica\Contact\Header; use Friendica\Contact\Introduction\Exception\IntroductionNotFoundException; -use Friendica\Contact\LocalRelationship\Entity\LocalRelationship; use Friendica\Content\Conversation as ConversationContent; use Friendica\Content\Pager; use Friendica\Content\Text\HTML; @@ -25,7 +25,8 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPClient\Client\HttpClientOptions; -use Friendica\Network\HTTPException; +use Friendica\Network\HTTPException\NotFoundException; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Network\Probe; use Friendica\Object\Image; use Friendica\Protocol\Activity; @@ -104,7 +105,7 @@ class Contact * @param array $condition Array of fields for condition * @param array $params Array of several parameters * @return array - * @throws \Exception + * @throws Exception */ public static function selectToArray(array $fields = [], array $condition = [], array $params = []): array { @@ -116,7 +117,7 @@ class Contact * @param array $condition Array of fields for condition * @param array $params Array of several parameters * @return array|bool - * @throws \Exception + * @throws Exception */ public static function selectFirst(array $fields = [], array $condition = [], array $params = []) { @@ -130,7 +131,7 @@ class Contact * @param array $condition Array of fields for condition * @param array $params Array of several parameters * @return array - * @throws \Exception + * @throws Exception */ public static function selectAccountToArray(array $fields = [], array $condition = [], array $params = []): array { @@ -142,7 +143,7 @@ class Contact * @param array $condition Array of fields for condition * @param array $params Array of several parameters * @return array|bool - * @throws \Exception + * @throws Exception */ public static function selectFirstAccount(array $fields = [], array $condition = [], array $params = []) { @@ -162,7 +163,7 @@ class Contact * @param int $duplicate_mode Do an update on a duplicate entry * * @return int id of the created contact - * @throws \Exception + * @throws Exception */ public static function insert(array $fields, int $duplicate_mode = Database::INSERT_DEFAULT): int { @@ -233,7 +234,7 @@ class Contact * @param array|boolean $old_fields array with the old field values that are about to be replaced (true = update on duplicate, false = don't update identical fields) * * @return boolean was the update successful? - * @throws \Exception + * @throws Exception * @todo Let's get rid of boolean type of $old_fields */ public static function update(array $fields, array $condition, $old_fields = []): bool @@ -249,7 +250,7 @@ class Contact * @param integer $id Contact ID * @param array $fields Array of selected fields, empty for all * @return array|boolean Contact record if it exists, false otherwise - * @throws \Exception + * @throws Exception */ public static function getAccountById(int $id, array $fields = []) { @@ -260,7 +261,7 @@ class Contact * @param integer $id Contact ID * @param array $fields Array of selected fields, empty for all * @return array|boolean Contact record if it exists, false otherwise - * @throws \Exception + * @throws Exception */ public static function getById(int $id, array $fields = []) { @@ -273,7 +274,7 @@ class Contact * @param integer $uri_id uri-id of the contact * @param array $fields Array of selected fields, empty for all * @return array|boolean Contact record if it exists, false otherwise - * @throws \Exception + * @throws Exception */ public static function getByUriId(int $uri_id, array $fields = []) { @@ -288,7 +289,7 @@ class Contact * * @return array all remote contacts * - * @throws \Exception + * @throws Exception */ public static function getVisitorByUrl(string $url, array $fields = ['id', 'uid']): array { @@ -432,7 +433,7 @@ class Contact * @param bool $strict If "true" then contact mustn't be set to pending or readonly * * @return boolean is the contact id a follower? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function isFollower(int $cid, int $uid, bool $strict = false): bool @@ -461,7 +462,7 @@ class Contact * @param bool $strict If "true" then contact mustn't be set to pending or readonly * * @return boolean is the contact id a follower? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function isFollowerByURL(string $url, int $uid, bool $strict = false): bool @@ -483,7 +484,7 @@ class Contact * @param bool $strict If "true" then contact mustn't be set to pending or readonly * * @return boolean is the contact sharing with given user? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function isSharing(int $cid, int $uid, bool $strict = false): bool @@ -512,7 +513,7 @@ class Contact * @param bool $strict If "true" then contact mustn't be set to pending or readonly * * @return boolean is the contact url being followed? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function isSharingByURL(string $url, int $uid, bool $strict = false): bool @@ -544,7 +545,7 @@ class Contact * @param boolean $dont_update Don't update the contact * * @return string basepath - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function getBasepath(string $url, bool $dont_update = false): string @@ -594,7 +595,7 @@ class Contact /** * Check if the given contact ID is on the same server * - * @param string $url The contact link + * @param int $cid The contact link * @return boolean Is it the same server? */ public static function isLocalById(int $cid): bool @@ -619,7 +620,7 @@ class Contact * @param integer $uid User ID * * @return integer|boolean Public contact id for given user id - * @throws \Exception + * @throws Exception */ public static function getPublicIdByUserId(int $uid) { @@ -634,7 +635,7 @@ class Contact * @param int $uid User ID * * @return array with public and user's contact id - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function getPublicAndUserContactID(int $cid, int $uid): array @@ -700,7 +701,7 @@ class Contact * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return array with public and user's contact id - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ private static function legacyGetPublicAndUserContactID(int $cid, int $uid): array @@ -741,7 +742,7 @@ class Contact * @param array $fields The selected fields for the contact * @return array The contact details * - * @throws \Exception + * @throws Exception */ public static function getContactForUser(int $cid, int $uid, array $fields = []): array { @@ -759,7 +760,7 @@ class Contact * * @param int $uid * @return bool Operation success - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function createSelfFromUserId(int $uid): bool { @@ -822,7 +823,7 @@ class Contact * @param int $uid * @param bool $update_avatar Force the avatar update * @return bool "true" if updated - * @throws \Exception + * @throws Exception */ public static function updateSelfFromUserID(int $uid, bool $update_avatar = false): bool { @@ -943,7 +944,7 @@ class Contact * * @param int $id contact id * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function remove(int $id) { @@ -973,7 +974,7 @@ class Contact * * @param array $contact Target user-specific contact (uid != 0) array * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function unfollow(array $contact): void @@ -1003,7 +1004,7 @@ class Contact * * @param array $contact User-specific contact array (uid != 0) to revoke the follow from * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function revokeFollow(array $contact): void @@ -1031,7 +1032,7 @@ class Contact * * @param array $contact User-specific contact (uid != 0) array * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function terminateFriendship(array $contact) @@ -1078,7 +1079,7 @@ class Contact * * @param array $contact contact to mark for archival * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function markForArchival(array $contact) { @@ -1129,7 +1130,7 @@ class Contact * * @param array $contact contact to be unmarked for archival * @return void - * @throws \Exception + * @throws Exception */ public static function unmarkForArchival(array $contact) { @@ -1169,7 +1170,7 @@ class Contact * @param array $contact contact * @param int $uid Visitor user id * @return array - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function photoMenu(array $contact, int $uid): array @@ -1301,7 +1302,7 @@ class Contact * @param array $default Default value for creating the contact when everything else fails * * @return integer Contact ID - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function getIdForURL(string $url = null, int $uid = 0, $update = null, array $default = []): int @@ -1442,7 +1443,7 @@ class Contact if ($data['network'] == Protocol::DIASPORA) { try { DI::dsprContact()->updateFromProbeArray($data); - } catch (HTTPException\NotFoundException $e) { + } catch (NotFoundException $e) { Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data]); } catch (\InvalidArgumentException $e) { Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data]); @@ -1450,7 +1451,7 @@ class Contact } elseif (!empty($data['networks'][Protocol::DIASPORA])) { try { DI::dsprContact()->updateFromProbeArray($data['networks'][Protocol::DIASPORA]); - } catch (HTTPException\NotFoundException $e) { + } catch (NotFoundException $e) { Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data['networks'][Protocol::DIASPORA]]); } catch (\InvalidArgumentException $e) { Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data['networks'][Protocol::DIASPORA]]); @@ -1475,7 +1476,7 @@ class Contact * @param int $cid contact id * * @return boolean Is the contact archived? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function isArchived(int $cid): bool { @@ -1518,7 +1519,7 @@ class Contact * * @param int $cid contact id * @return boolean Is the contact blocked? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function isBlocked(int $cid): bool { @@ -1543,7 +1544,7 @@ class Contact * * @param int $cid contact id * @return boolean Is the contact hidden? - * @throws \Exception + * @throws Exception */ public static function isHidden(int $cid): bool { @@ -1566,7 +1567,7 @@ class Contact * @param bool $only_media Only display media content * @param string $last_created Newest creation date, used for paging * @return string posts in HTML - * @throws \Exception + * @throws Exception */ public static function getPostsFromUrl(string $contact_url, int $uid, bool $only_media = false, string $last_created = null): string { @@ -1581,7 +1582,7 @@ class Contact * @param bool $only_media Only display media content * @param string $last_created Newest creation date, used for paging * @return string posts in HTML - * @throws \Exception + * @throws Exception */ public static function getPostsFromId(int $cid, int $uid, bool $only_media = false, string $last_created = null): string { @@ -1653,7 +1654,7 @@ class Contact * @param int $update Update mode * @param int $parent Item parent ID for the update mode * @return string posts in HTML - * @throws \Exception + * @throws Exception */ public static function getThreadsFromId(int $cid, int $uid, int $update = 0, int $parent = 0, string $last_created = ''): string { @@ -2286,8 +2287,8 @@ class Contact * @param bool $create_cache Enforces the creation of cached avatar fields * * @return void - * @throws HTTPException\InternalServerErrorException - * @throws HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws NotFoundException * @throws \ImagickException */ public static function updateAvatar(int $cid, string $avatar, bool $force = false, bool $create_cache = false) @@ -2486,7 +2487,7 @@ class Contact * @param integer $id contact id * @param string $url The new URL to use for polling * - * @throws \Exception + * @throws Exception */ public static function updatePollUrl(int $id, string $url) { @@ -2502,7 +2503,7 @@ class Contact * @param string $url The profile URL of the contact * @param array $fields The fields that are updated * - * @throws \Exception + * @throws Exception */ private static function updateContact(int $id, int $uid, int $uri_id, string $url, array $fields) { @@ -2595,7 +2596,7 @@ class Contact * @param string $nurl Normalised contact url * @param integer $uid User id * @return boolean - * @throws \Exception + * @throws Exception */ public static function removeDuplicates(string $nurl, int $uid) { @@ -2673,7 +2674,7 @@ class Contact * @param integer $id contact id * @param string $network Optional network we are probing for * @return boolean - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function updateFromProbe(int $id, string $network = ''): bool @@ -2696,7 +2697,7 @@ class Contact if ($data['network'] == Protocol::DIASPORA) { try { DI::dsprContact()->updateFromProbeArray($data); - } catch (HTTPException\NotFoundException $e) { + } catch (NotFoundException $e) { Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]); } catch (\InvalidArgumentException $e) { Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]); @@ -2704,7 +2705,7 @@ class Contact } elseif (!empty($data['networks'][Protocol::DIASPORA])) { try { DI::dsprContact()->updateFromProbeArray($data['networks'][Protocol::DIASPORA]); - } catch (HTTPException\NotFoundException $e) { + } catch (NotFoundException $e) { Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]); } catch (\InvalidArgumentException $e) { Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]); @@ -2760,7 +2761,7 @@ class Contact * @param integer $id contact id * @param array $ret Probed data * @return boolean - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ private static function updateFromProbeArray(int $id, array $ret): bool @@ -3012,9 +3013,9 @@ class Contact /** * Updates contact record by provided URL * - * @param integer $url contact url - * @return integer Contact id - * @throws HTTPException\InternalServerErrorException + * @param string $url contact url + * @return int Contact id + * @throws InternalServerErrorException * @throws \ImagickException */ public static function updateFromProbeByURL(string $url): int @@ -3069,8 +3070,8 @@ class Contact * @param string $url The profile URL of the contact * @param string $network * @return array - * @throws HTTPException\InternalServerErrorException - * @throws HTTPException\NotFoundException + * @throws InternalServerErrorException + * @throws NotFoundException * @throws \ImagickException */ public static function createFromProbeForUser(int $uid, string $url, string $network = ''): array @@ -3258,7 +3259,7 @@ class Contact * @param bool $sharing True: Contact is now sharing with Owner; False: Contact is now following Owner (default) * @param string $note Introduction additional message * @return bool|null True: follow request is accepted; False: relationship is rejected; Null: relationship is pending - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function addRelationship(array $importer, array $contact, array $datarray, bool $sharing = false, string $note = '') @@ -3415,7 +3416,7 @@ class Contact * @param array $contact User-specific contact (uid != 0) array * @param bool $delete Delete if set, otherwise set relation to "nothing" when contact had been a follower * @return void - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function removeFollower(array $contact, bool $delete = true) @@ -3449,7 +3450,7 @@ class Contact * * @param array $contact User-specific contact (uid != 0) array * @param bool $delete Delete if set, otherwise set relation to "nothing" when contact had been a sharer - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException */ public static function removeSharer(array $contact, bool $delete = true) { @@ -3512,7 +3513,7 @@ class Contact * * @param array $contact_ids Contact id list * @return array - * @throws \Exception + * @throws Exception */ public static function pruneUnavailable(array $contact_ids): array { @@ -3554,7 +3555,7 @@ class Contact * @param string $url An url that we will be redirected to after the authentication * * @return string with "redir" link - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function magicLink(string $contact_url, string $url = ''): string @@ -3581,7 +3582,7 @@ class Contact * @param string $url An url that we will be redirected to after the authentication * * @return string with "redir" link - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function magicLinkById(int $cid, string $url = ''): string @@ -3605,7 +3606,7 @@ class Contact * @param string $url An url that we will be redirected to after the authentication * * @return string with "redir" link - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function magicLinkByContact(array $contact, string $url = ''): string @@ -3810,7 +3811,7 @@ class Contact * @param array $condition * * @return bool - * @throws \Exception + * @throws Exception */ public static function exists(array $condition): bool { diff --git a/src/Model/Contact/User.php b/src/Model/Contact/User.php index 66a3721193..8e0f033fe6 100644 --- a/src/Model/Contact/User.php +++ b/src/Model/Contact/User.php @@ -15,6 +15,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\ItemURI; +use Friendica\Network\HTTPException\InternalServerErrorException; use PDOException; /** @@ -130,7 +131,7 @@ class User * @param boolean $blocked Is the contact blocked or unblocked? * @param boolean $only_set Only set the block flag, don't execute any block transmission * @return void - * @throws \Exception + * @throws Exception */ public static function setBlocked(int $cid, int $uid, bool $blocked, bool $only_set = false) { @@ -171,7 +172,7 @@ class User * @param int $uid User ID * * @return boolean is the contact id blocked for the given user? - * @throws \Exception + * @throws Exception */ public static function isBlocked(int $cid, int $uid): bool { @@ -212,7 +213,7 @@ class User * @param int $uid User ID * @param boolean $ignored Is the contact ignored or unignored? * @return void - * @throws \Exception + * @throws Exception */ public static function setIgnored(int $cid, int $uid, bool $ignored) { @@ -234,7 +235,7 @@ class User * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return boolean is the contact id ignored for the given user? - * @throws \Exception + * @throws Exception */ public static function isIgnored(int $cid, int $uid): bool { @@ -275,7 +276,7 @@ class User * @param int $uid User ID * @param boolean $collapsed are the contact's posts collapsed or uncollapsed? * @return void - * @throws \Exception + * @throws Exception */ public static function setCollapsed(int $cid, int $uid, bool $collapsed) { @@ -293,7 +294,7 @@ class User * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return boolean is the contact id blocked for the given user? - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function isCollapsed(int $cid, int $uid): bool @@ -314,7 +315,7 @@ class User * @param int $uid User ID * @param int $frequency Type of post frequency in channels * @return void - * @throws \Exception + * @throws Exception */ public static function setChannelFrequency(int $cid, int $uid, int $frequency) { @@ -332,7 +333,7 @@ class User * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return int Type of post frequency in channels - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function getChannelFrequency(int $cid, int $uid): int @@ -349,11 +350,11 @@ class User /** * Set the channel only value for contact id and user id * - * @param int $cid Either public contact id or user's contact id - * @param int $uid User ID - * @param int $isChannelOnly Is channel only + * @param int $cid Either public contact id or user's contact id + * @param int $uid User ID + * @param bool $isChannelOnly Is channel only * @return void - * @throws \Exception + * @throws Exception */ public static function setChannelOnly(int $cid, int $uid, bool $isChannelOnly) { @@ -371,7 +372,7 @@ class User * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return bool Contact is channel only - * @throws HTTPException\InternalServerErrorException + * @throws InternalServerErrorException * @throws \ImagickException */ public static function getChannelOnly(int $cid, int $uid): bool @@ -392,7 +393,7 @@ class User * @param int $uid User ID * @param boolean $blocked Is the user blocked or unblocked by the contact? * @return void - * @throws \Exception + * @throws Exception */ public static function setIsBlocked(int $cid, int $uid, bool $blocked) { @@ -410,7 +411,7 @@ class User * @param int $cid Either public contact id or user's contact id * @param int $uid User ID * @return boolean Is the user blocked or unblocked by the contact? - * @throws \Exception + * @throws Exception */ public static function isIsBlocked(int $cid, int $uid): bool { diff --git a/src/Model/Event.php b/src/Model/Event.php index 210f601691..f98c8cdd0c 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -15,7 +15,9 @@ use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Network\HTTPException; +use Friendica\Network\HTTPException\InternalServerErrorException; +use Friendica\Network\HTTPException\NotFoundException; +use Friendica\Network\HTTPException\UnauthorizedException; use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; use Friendica\Util\Map; @@ -487,23 +489,23 @@ class Event * @param string $nickname * * @return array the owner array - * @throws HTTPException\InternalServerErrorException - * @throws HTTPException\NotFoundException The given nickname does not exist - * @throws HTTPException\UnauthorizedException The access for the given nickname is restricted + * @throws InternalServerErrorException + * @throws NotFoundException The given nickname does not exist + * @throws UnauthorizedException The access for the given nickname is restricted */ public static function getOwnerForNickname(string $nickname): array { $owner = User::getOwnerDataByNick($nickname); if (empty($owner) || $owner['account_removed'] || $owner['account_expired']) { - throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); + throw new NotFoundException(DI::l10n()->t('User not found.')); } if (!DI::userSession()->isAuthenticated() && $owner['hidewall']) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access to this profile has been restricted.')); + throw new UnauthorizedException(DI::l10n()->t('Access to this profile has been restricted.')); } if (!DI::userSession()->isAuthenticated() && !Feature::isEnabled($owner['uid'], Feature::PUBLIC_CALENDAR)) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.')); + throw new UnauthorizedException(DI::l10n()->t('Permission denied.')); } return $owner; @@ -514,7 +516,6 @@ class Event * * @param int $owner_uid The User ID of the owner of the event * @param int $event_id The ID of the event in the event table - * @param string|null $nickname a possible nickname to search for instead of the owner uid * @return array Query result * @throws \Exception */ @@ -541,7 +542,7 @@ class Event $owner_uid )); if (empty($events)) { - throw new HTTPException\NotFoundException(DI::l10n()->t('Event not found.')); + throw new NotFoundException(DI::l10n()->t('Event not found.')); } return $events[0]; @@ -556,8 +557,8 @@ class Event * @param bool|null $ignore Filters ignored events (false: unignored events, true: ignored events, null: all events) * * @return array Query results. - * @throws HTTPException\NotFoundException - * @throws HTTPException\UnauthorizedException + * @throws NotFoundException + * @throws UnauthorizedException */ public static function getListByDate(int $owner_uid, string $start = null, string $finish = null, ?bool $ignore = false): array { diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 5e8cd33310..a0c1be7bfc 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -163,9 +163,6 @@ class GServer /** * Checks if the given server array is unreachable for a long time now - * - * @param integer $gsid - * @return boolean */ private static function isDefunct(array $gserver): bool { @@ -509,7 +506,7 @@ class GServer * @return UriInterface cleaned URI * @throws Exception */ - public static function cleanUri(UriInterface $dirtyUri): string + public static function cleanUri(UriInterface $dirtyUri): UriInterface { return $dirtyUri ->withUserInfo('') @@ -1349,8 +1346,6 @@ class GServer * * @see https://github.com/jaywink/nodeinfo2 * - * @param string $nodeinfo_url address of the nodeinfo path - * * @return array Server data * * @throws \Friendica\Network\HTTPException\InternalServerErrorException @@ -1539,7 +1534,6 @@ class GServer /** * Fetches server data via an ActivityPub account with url of that server * - * @param string $url URL of the given server * @param array $serverdata array with server data * * @return array server data diff --git a/src/Model/Item.php b/src/Model/Item.php index b42f89729a..7a62c3677d 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -445,7 +445,7 @@ class Item * Get guid from given item record * * @param array $item Item record - * @param bool Whether to notify (?) + * @param bool $notify Whether to notify (?) * @return string Guid */ public static function guid(array $item, bool $notify): string @@ -2123,7 +2123,6 @@ class Item * * @param array $item * @return string detected language - * @throws \Text_LanguageDetect_Exception */ private static function getLanguage(array $item): ?string { @@ -3571,7 +3570,7 @@ class Item } $xpath = new \DOMXPath($dom); - /** @var DOMElement $element */ + /** @var \DOMElement $element */ foreach ($xpath->query("//img[@class='network-svg']") as $element) { $src = $element->getAttributeNode('src')->nodeValue; if ($src == $svg) { diff --git a/src/Model/Log/ParsedLogIterator.php b/src/Model/Log/ParsedLogIterator.php index 0843c0921c..44c98462c1 100644 --- a/src/Model/Log/ParsedLogIterator.php +++ b/src/Model/Log/ParsedLogIterator.php @@ -18,7 +18,7 @@ use Friendica\Object\Log\ParsedLogLine; */ class ParsedLogIterator implements \Iterator { - /** @var \Iterator */ + /** @var ReversedFileReader */ private $reader; /** @var ParsedLogLine current iterator value*/ @@ -33,10 +33,6 @@ class ParsedLogIterator implements \Iterator /** @var string search term */ private $search = ''; - - /** - * @param ReversedFileReader $reader - */ public function __construct(ReversedFileReader $reader) { $this->reader = $reader; diff --git a/src/Model/Photo.php b/src/Model/Photo.php index e2d38241d8..1858a1b590 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -489,14 +489,11 @@ class Photo * Delete info from table and data from storage * * @param array $conditions Field condition(s) - * @param array $options Options array, Optional - * - * @return boolean * * @throws \Exception * @see \Friendica\Database\DBA::delete */ - public static function delete(array $conditions, array $options = []): bool + public static function delete(array $conditions): bool { // get photo to delete data info $photos = DBA::select('photo', ['id', 'backend-class', 'backend-ref'], $conditions); @@ -516,7 +513,7 @@ class Photo DBA::close($photos); - return DBA::delete('photo', $conditions, $options); + return DBA::delete('photo', $conditions); } /** diff --git a/src/Model/Post.php b/src/Model/Post.php index 3439ce4846..3118e2e84c 100644 --- a/src/Model/Post.php +++ b/src/Model/Post.php @@ -19,8 +19,6 @@ class Post /** * Insert a new post entry * - * @param integer $uri_id - * @param array $fields * @return bool Success of the insert process * @throws \Exception */ @@ -184,10 +182,6 @@ class Post /** * Retrieve a single record from the post-user-view view and returns it in an associative array * - * @param array $fields - * @param array $condition - * @param array $params - * @param bool $user_mode true = post-user-view, false = post-view * @return bool|array * @throws \Exception * @see DBA::select @@ -212,10 +206,6 @@ class Post * When the requested record is a reshare activity, the system fetches the reshared original post. * Otherwise the function reacts similar to selectFirst * - * @param array $fields - * @param array $condition - * @param array $params - * @param bool $user_mode true = post-user-view, false = post-view * @return bool|array * @throws \Exception * @see DBA::select @@ -300,7 +290,7 @@ class Post /** * Select rows from the post-user-view view and returns them as an array * - * @param array $selected Array of selected fields, empty for all + * @param array $fields Array of selected fields, empty for all * @param array $condition Array of fields for condition * @param array $params Array of several parameters * @@ -767,15 +757,12 @@ class Post * Delete a row from the post table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []): bool + public static function delete(array $conditions): bool { - return DBA::delete('post', $conditions, $options); + return DBA::delete('post', $conditions); } } diff --git a/src/Model/Post/Activity.php b/src/Model/Post/Activity.php index 7d3bb89460..3996ce9f49 100644 --- a/src/Model/Post/Activity.php +++ b/src/Model/Post/Activity.php @@ -16,9 +16,6 @@ class Activity /** * Insert a new post-activity entry * - * @param integer $uri_id - * @param array $fields - * * @return bool success */ public static function insert(int $uri_id, string $source): bool diff --git a/src/Model/Post/Category.php b/src/Model/Post/Category.php index 6afb657751..558fb7059a 100644 --- a/src/Model/Post/Category.php +++ b/src/Model/Post/Category.php @@ -140,8 +140,6 @@ class Category * Inserts new terms for the provided item ID based on the legacy item.file field BBCode content. * Deletes all previous file terms for the same item ID. * - * @param integer $item_id item id - * @param $files * @return void * @throws \Exception */ diff --git a/src/Model/Post/Collection.php b/src/Model/Post/Collection.php index a04cdc832f..d57ab6d7a1 100644 --- a/src/Model/Post/Collection.php +++ b/src/Model/Post/Collection.php @@ -62,9 +62,6 @@ class Collection /** * Fetch collections for a given contact * - * @param integer $cid - * @param [type] $type - * @param array $fields * @return array */ public static function selectToArrayForContact(int $cid, int $type = self::FEATURED, array $fields = []) diff --git a/src/Model/Post/Content.php b/src/Model/Post/Content.php index dcb7b9be7e..1b3dd3a0d8 100644 --- a/src/Model/Post/Content.php +++ b/src/Model/Post/Content.php @@ -11,7 +11,6 @@ use \BadMethodCallException; use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Model\Item; use Friendica\Model\Post; class Content @@ -19,8 +18,6 @@ class Content /** * Insert a new post-content entry * - * @param integer $uri_id - * @param array $fields * @return bool success * @throws \Exception */ @@ -69,16 +66,13 @@ class Content * Delete a row from the post-content table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []) + public static function delete(array $conditions) { - return DBA::delete('post-content', $conditions, $options); + return DBA::delete('post-content', $conditions); } diff --git a/src/Model/Post/Delivery.php b/src/Model/Post/Delivery.php index 972e0084ca..90d7be6eff 100644 --- a/src/Model/Post/Delivery.php +++ b/src/Model/Post/Delivery.php @@ -17,11 +17,6 @@ class Delivery { /** * Add a post to an inbox - * - * @param integer $uri_id - * @param string $inbox - * @param string $created - * @param array %receivers */ public static function add(int $uri_id, int $uid, string $inbox, string $created, string $command, array $receivers) { diff --git a/src/Model/Post/Origin.php b/src/Model/Post/Origin.php index dafe52be6f..c925c65a72 100644 --- a/src/Model/Post/Origin.php +++ b/src/Model/Post/Origin.php @@ -17,7 +17,6 @@ class Origin /** * Insert a new post origin entry * - * @param array $fields * @return boolean was the insert successful? * @throws \Exception */ @@ -65,15 +64,12 @@ class Origin * Delete a row from the post-origin table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []) + public static function delete(array $conditions) { - return DBA::delete('post-origin', $conditions, $options); + return DBA::delete('post-origin', $conditions); } } diff --git a/src/Model/Post/Thread.php b/src/Model/Post/Thread.php index fc714a5a76..d3952fe624 100644 --- a/src/Model/Post/Thread.php +++ b/src/Model/Post/Thread.php @@ -10,7 +10,6 @@ namespace Friendica\Model\Post; use \BadMethodCallException; use Friendica\Database\Database; use Friendica\Database\DBA; -use Friendica\Database\DBStructure; use Friendica\DI; class Thread @@ -18,8 +17,6 @@ class Thread /** * Insert a new post-thread entry * - * @param integer $uri_id - * @param array $fields * @return bool success * @throws \Exception */ @@ -68,15 +65,12 @@ class Thread * Delete a row from the post-thread table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []) + public static function delete(array $conditions) { - return DBA::delete('post-thread', $conditions, $options); + return DBA::delete('post-thread', $conditions); } } diff --git a/src/Model/Post/ThreadUser.php b/src/Model/Post/ThreadUser.php index 6e06879cd8..b2f4bc0806 100644 --- a/src/Model/Post/ThreadUser.php +++ b/src/Model/Post/ThreadUser.php @@ -7,10 +7,10 @@ namespace Friendica\Model\Post; -use \BadMethodCallException; +use BadMethodCallException; +use Exception; use Friendica\Database\Database; use Friendica\Database\DBA; -use Friendica\Database\DBStructure; use Friendica\DI; class ThreadUser @@ -18,9 +18,6 @@ class ThreadUser /** * Insert a new URI user entry * - * @param integer $uri_id - * @param integer $uid - * @param array $fields * @return bool success * @throws \Exception */ @@ -72,16 +69,13 @@ class ThreadUser * Delete a row from the post-thread-user table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []) + public static function delete(array $conditions) { - return DBA::delete('post-thread-user', $conditions, $options); + return DBA::delete('post-thread-user', $conditions); } /** diff --git a/src/Model/Post/User.php b/src/Model/Post/User.php index c1a74427cc..0466b2c0a8 100644 --- a/src/Model/Post/User.php +++ b/src/Model/Post/User.php @@ -7,9 +7,9 @@ namespace Friendica\Model\Post; -use Friendica\Database\DBA; -use \BadMethodCallException; +use BadMethodCallException; use Friendica\Database\Database; +use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; use Friendica\Protocol\Activity; @@ -19,9 +19,6 @@ class User /** * Insert a new post user entry * - * @param integer $uri_id - * @param integer $uid - * @param array $fields * @return int ID of inserted post-user * @throws \Exception */ @@ -109,15 +106,12 @@ class User * Delete a row from the post-user table * * @param array $conditions Field condition(s) - * @param array $options - * - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the delete successful? * @throws \Exception */ - public static function delete(array $conditions, array $options = []) + public static function delete(array $conditions) { - return DBA::delete('post-user', $conditions, $options); + return DBA::delete('post-user', $conditions); } } diff --git a/src/Model/Post/UserNotification.php b/src/Model/Post/UserNotification.php index f20d947c07..35c3d7891c 100644 --- a/src/Model/Post/UserNotification.php +++ b/src/Model/Post/UserNotification.php @@ -95,15 +95,13 @@ class UserNotification * Delete a row from the post-user-notification table * * @param array $conditions Field condition(s) - * @param array $options - cascade: If true we delete records in other tables that depend on the one we're deleting through - * relations (default: true) * * @return boolean was the deletion successful? * @throws Exception */ - public static function delete(array $conditions, array $options = []): bool + public static function delete(array $conditions): bool { - return DBA::delete('post-user-notification', $conditions, $options); + return DBA::delete('post-user-notification', $conditions); } /** diff --git a/src/Model/Profile.php b/src/Model/Profile.php index e8ebe89d57..a8c9d32c07 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -33,7 +33,7 @@ class Profile /** * Returns default profile for a given user id * - * @param integer User ID + * @param int $uid User ID * * @return array|bool Profile data or false on error * @throws \Exception @@ -61,8 +61,8 @@ class Profile /** * Returns profile data for the contact owner * - * @param int $uid The User ID - * @param array|bool $fields The fields to retrieve or false on error + * @param int $uid The User ID + * @param array $fields The fields to retrieve or false on error * * @return array Array of profile data * @throws \Exception diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index c1be9f10e8..be18a1af78 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -12,7 +12,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Factory\Api\Mastodon\Notification as NotificationFactory; -use Friendica\Navigation\Notifications\Entity; +use Friendica\Navigation\Notifications\Entity\Notification as NotificationEntity; use Friendica\Object\Api\Mastodon\Notification; use Minishlink\WebPush\VAPID; @@ -21,9 +21,6 @@ class Subscription /** * Select a subscription record exists * - * @param int $applicationid - * @param int $uid - * @param array $fields * @return array|bool Array on success, false on failure */ public static function select(int $applicationid, int $uid, array $fields = []) @@ -120,10 +117,9 @@ class Subscription /** * Prepare push notification * - * @param Notification $Notification * @return void */ - public static function pushByNotification(Entity\Notification $notification) + public static function pushByNotification(NotificationEntity $notification) { $type = NotificationFactory::getType($notification); diff --git a/src/Model/User.php b/src/Model/User.php index 3310695a8e..3d107ca79c 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -521,7 +521,6 @@ class User /** * Get owner data by nick name * - * @param int $nick * @return boolean|array * @throws Exception */ @@ -1215,6 +1214,7 @@ class User $_SESSION['openid'] = $openid_url; $openid = new LightOpenID(DI::baseUrl()->getHost()); + /** @phpstan-ignore-next-line $openid->identity is private, but will be set via magic setter */ $openid->identity = $openid_url; $openid->returnUrl = DI::baseUrl() . '/openid'; $openid->required = ['namePerson/friendly', 'contact/email', 'namePerson']; diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 736c8b3e2e..f07e9720cb 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -9,7 +9,6 @@ namespace Friendica\Module\Admin; use Friendica\App; use Friendica\Core\Addon; -use Friendica\Core\Config\Util\ConfigFileManager; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Renderer; use Friendica\Core\Update; @@ -19,7 +18,6 @@ use Friendica\DI; use Friendica\Core\Config\Factory\Config; use Friendica\Module\BaseAdmin; use Friendica\Network\HTTPClient\Client\HttpClientAccept; -use Friendica\Network\HTTPException\ServiceUnavailableException; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; @@ -55,7 +53,7 @@ class Summary extends BaseAdmin $table_definition_cache = DBA::getVariable('table_definition_cache'); $table_open_cache = DBA::getVariable('table_open_cache'); if (!empty($table_definition_cache) && !empty($table_open_cache)) { - $suggested_definition_cache = min(400 + round($table_open_cache / 2, 1), 2000); + $suggested_definition_cache = min(400 + round((int) $table_open_cache / 2, 1), 2000); if ($suggested_definition_cache > $table_definition_cache) { $warningtext[] = DI::l10n()->t('Your table_definition_cache is too low (%d). This can lead to the database error "Prepared statement needs to be re-prepared". Please set it at least to %d. See here for more information.
', $table_definition_cache, $suggested_definition_cache, 'https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache'); } diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index a2efbfc1cc..db7328128c 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -252,7 +252,7 @@ class BaseApi extends BaseModule /** * Set boundaries for the "link" header - * @param array $boundaries + * * @param int|\DateTime $id */ protected static function setBoundaries($id) diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index 7e97e52d3f..979b5d70d6 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -9,7 +9,8 @@ namespace Friendica\Module; use DOMDocument; use DOMElement; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; @@ -31,7 +32,7 @@ class OpenSearch extends BaseModule /** @var string */ private $basePath; - public function __construct(BasePath $basePath, IManageConfigValues $config, L10n $l10n, App\baseUrl $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + public function __construct(BasePath $basePath, IManageConfigValues $config, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -44,20 +45,23 @@ class OpenSearch extends BaseModule */ protected function rawContent(array $request = []) { - /** @var DOMDocument $xml */ - XML::fromArray([ - 'OpenSearchDescription' => [ - '@attributes' => [ - 'xmlns' => 'http://a9.com/-/spec/opensearch/1.1/', + XML::fromArray( + [ + 'OpenSearchDescription' => [ + '@attributes' => [ + 'xmlns' => 'http://a9.com/-/spec/opensearch/1.1/', + ], + 'ShortName' => $this->baseUrl->getHost(), + 'Description' => $this->l10n->t('Search in Friendica %s', $this->baseUrl->getHost()), + 'Contact' => 'https://github.com/friendica/friendica/issues', + 'InputEncoding' => 'UTF-8', + 'OutputEncoding' => 'UTF-8', + 'Developer' => 'Friendica Developer Team', ], - 'ShortName' => $this->baseUrl->getHost(), - 'Description' => $this->l10n->t('Search in Friendica %s', $this->baseUrl->getHost()), - 'Contact' => 'https://github.com/friendica/friendica/issues', - 'InputEncoding' => 'UTF-8', - 'OutputEncoding' => 'UTF-8', - 'Developer' => 'Friendica Developer Team', ], - ], $xml); + /** @var DOMDocument $xml */ + $xml + ); /** @var DOMElement $parent */ $parent = $xml->getElementsByTagName('OpenSearchDescription')[0]; diff --git a/src/Module/Security/OpenID.php b/src/Module/Security/OpenID.php index c8b8f9a95c..ab77e551ef 100644 --- a/src/Module/Security/OpenID.php +++ b/src/Module/Security/OpenID.php @@ -69,7 +69,9 @@ class OpenID extends BaseModule // Detect the server URL $open_id_obj = new LightOpenID(DI::baseUrl()->getHost()); + /** @phpstan-ignore-next-line $openid->identity is private, but will be set via magic setter */ $open_id_obj->identity = $authId; + /** @phpstan-ignore-next-line $openid->identity is private, but will be retrieved via magic getter */ $session->set('openid_server', $open_id_obj->discover($open_id_obj->identity)); if (\Friendica\Module\Register::getPolicy() === \Friendica\Module\Register::CLOSED) { diff --git a/src/Module/Special/HTTPException.php b/src/Module/Special/HTTPException.php index 9a02345ce0..f92d33c18a 100644 --- a/src/Module/Special/HTTPException.php +++ b/src/Module/Special/HTTPException.php @@ -7,13 +7,16 @@ namespace Friendica\Module\Special; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\Request; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Model\UserSession; use Friendica\Core\System; use Friendica\Module\Response; +use Friendica\Network\HTTPException as NetworkHTTPException; use Psr\Log\LoggerInterface; +use Throwable; /** * This special module displays HTTPException when they are thrown in modules. @@ -26,7 +29,7 @@ class HTTPException protected $l10n; /** @var LoggerInterface */ protected $logger; - /** @var App\Arguments */ + /** @var Arguments */ protected $args; /** @var bool */ protected $isSiteAdmin; @@ -35,7 +38,7 @@ class HTTPException /** @var string */ protected $requestId; - public function __construct(L10n $l10n, LoggerInterface $logger, App\Arguments $args, UserSession $session, App\Request $request, array $server = []) + public function __construct(L10n $l10n, LoggerInterface $logger, Arguments $args, UserSession $session, Request $request, array $server = []) { $this->logger = $logger; $this->l10n = $l10n; @@ -50,11 +53,9 @@ class HTTPException * * Fills in the blanks if title or descriptions aren't provided by the exception. * - * @param \Friendica\Network\HTTPException $e - * * @return array ['$title' => ..., '$description' => ...] */ - private function getVars(\Friendica\Network\HTTPException $e) + private function getVars(NetworkHTTPException $e) { // Explanations are mostly taken from https://en.wikipedia.org/wiki/List_of_HTTP_status_codes $vars = [ @@ -76,11 +77,9 @@ class HTTPException /** * Displays a bare message page with no theming at all. * - * @param \Friendica\Network\HTTPException $e - * * @throws \Exception */ - public function rawContent(\Friendica\Network\HTTPException $e) + public function rawContent(NetworkHTTPException $e) { $content = ''; @@ -89,7 +88,7 @@ class HTTPException try { $tpl = Renderer::getMarkupTemplate('http_status.tpl'); $content = Renderer::replaceMacros($tpl, $vars); - } catch (\Exception $e) { + } catch (Throwable $th) { $vars = array_map('htmlentities', $vars); $content = "

{$vars['$title']}

{$vars['$message']}

"; if ($this->isSiteAdmin) { @@ -111,12 +110,10 @@ class HTTPException /** * Returns a content string that can be integrated in the current theme. * - * @param \Friendica\Network\HTTPException $e - * * @return string * @throws \Exception */ - public function content(\Friendica\Network\HTTPException $e): string + public function content(NetworkHTTPException $e): string { if ($e->getCode() >= 400) { $this->logger->debug('Exit with error', diff --git a/src/Navigation/Notifications/Entity/Notification.php b/src/Navigation/Notifications/Entity/Notification.php index 21cf897893..a75b55eea4 100644 --- a/src/Navigation/Notifications/Entity/Notification.php +++ b/src/Navigation/Notifications/Entity/Notification.php @@ -11,16 +11,16 @@ use DateTime; use Friendica\BaseEntity; /** - * @property-read $id - * @property-read $uid - * @property-read $verb - * @property-read $type - * @property-read $actorId - * @property-read $targetUriId - * @property-read $parentUriId - * @property-read $created - * @property-read $seen - * @property-read $dismissed + * @property-read int $id + * @property-read int $uid + * @property-read string $verb + * @property-read int $type + * @property-read int $actorId + * @property-read int $targetUriId + * @property-read int $parentUriId + * @property-read DateTime $created + * @property-read bool $seen + * @property-read bool $dismissed */ class Notification extends BaseEntity { @@ -31,7 +31,7 @@ class Notification extends BaseEntity /** @var string */ protected $verb; /** - * @var int One of the \Friendica\Model\Post\UserNotification::TYPE_* constant values + * @var int $type One of the \Friendica\Model\Post\UserNotification::TYPE_* constant values * @see \Friendica\Model\Post\UserNotification */ protected $type; diff --git a/src/Navigation/Notifications/Entity/Notify.php b/src/Navigation/Notifications/Entity/Notify.php index 6f42fae556..3ff478633e 100644 --- a/src/Navigation/Notifications/Entity/Notify.php +++ b/src/Navigation/Notifications/Entity/Notify.php @@ -14,24 +14,24 @@ use Friendica\Core\Renderer; use Psr\Http\Message\UriInterface; /** - * @property-read $type - * @property-read $name - * @property-read $url - * @property-read $photo - * @property-read $date - * @property-read $msg - * @property-read $uid - * @property-read $link - * @property-read $itemId - * @property-read $parent - * @property-read $seen - * @property-read $verb - * @property-read $otype - * @property-read $name_cache - * @property-read $msg_cache - * @property-read $uriId - * @property-read $parentUriId - * @property-read $id + * @property-read string $type + * @property-read string $name + * @property-read UriInterface $url + * @property-read UriInterface $photo + * @property-read DateTime $date + * @property-read string|null $msg + * @property-read int $uid + * @property-read UriInterface $link + * @property-read int|null $itemId + * @property-read int|null $parent + * @property-read bool $seen + * @property-read string $verb + * @property-read string|null $otype + * @property-read string|null $name_cache + * @property-read string|null $msg_cache + * @property-read int|null $uriId + * @property-read int|null $parentUriId + * @property-read int|null $id * * @deprecated since 2022.05 Use \Friendica\Navigation\Notifications\Entity\Notification instead */ diff --git a/src/Navigation/Notifications/ValueObject/FormattedNavNotification.php b/src/Navigation/Notifications/ValueObject/FormattedNavNotification.php index 913618294d..16543f9ac1 100644 --- a/src/Navigation/Notifications/ValueObject/FormattedNavNotification.php +++ b/src/Navigation/Notifications/ValueObject/FormattedNavNotification.php @@ -11,6 +11,8 @@ use Friendica\BaseEntity; /** * A view-only object for printing item notifications to the frontend + * + * @property-read bool $seen */ class FormattedNavNotification extends BaseEntity { diff --git a/src/Object/Api/Mastodon/Activity.php b/src/Object/Api/Mastodon/Activity.php index cab2b30068..5617bc7e7f 100644 --- a/src/Object/Api/Mastodon/Activity.php +++ b/src/Object/Api/Mastodon/Activity.php @@ -28,7 +28,6 @@ class Activity extends BaseDataTransferObject /** * Creates an activity * - * @param array $item * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(int $week, int $statuses, int $logins, int $registrations) diff --git a/src/Object/Api/Mastodon/Application.php b/src/Object/Api/Mastodon/Application.php index 789b445d0c..50837f90cb 100644 --- a/src/Object/Api/Mastodon/Application.php +++ b/src/Object/Api/Mastodon/Application.php @@ -34,7 +34,6 @@ class Application extends BaseDataTransferObject /** * Creates an application entry * - * @param array $item * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(string $name, string $client_id = null, string $client_secret = null, int $id = null, string $redirect_uri = null, string $website = null, string $vapid_key = null) diff --git a/src/Object/Api/Mastodon/Emoji.php b/src/Object/Api/Mastodon/Emoji.php index 8edbccc36f..a91f158e72 100644 --- a/src/Object/Api/Mastodon/Emoji.php +++ b/src/Object/Api/Mastodon/Emoji.php @@ -32,7 +32,6 @@ class Emoji extends BaseDataTransferObject // Optional attributes /** * Unsupported - * @var string */ //protected $category; diff --git a/src/Object/Api/Mastodon/Error.php b/src/Object/Api/Mastodon/Error.php index 220f00e8be..945ebfc592 100644 --- a/src/Object/Api/Mastodon/Error.php +++ b/src/Object/Api/Mastodon/Error.php @@ -23,9 +23,6 @@ class Error extends BaseDataTransferObject /** * Creates an error record - * - * @param string $error - * @param string error_description */ public function __construct(string $error, string $error_description) { diff --git a/src/Object/Api/Mastodon/ListEntity.php b/src/Object/Api/Mastodon/ListEntity.php index ab3b6363ad..0bd613d0f9 100644 --- a/src/Object/Api/Mastodon/ListEntity.php +++ b/src/Object/Api/Mastodon/ListEntity.php @@ -26,8 +26,6 @@ class ListEntity extends BaseDataTransferObject /** * Creates an list record * - * @param int $id - * @param string $title * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(string $id, string $title, string $policy) diff --git a/src/Object/Api/Mastodon/Preferences.php b/src/Object/Api/Mastodon/Preferences.php index 68f3c922a8..fcae499d92 100644 --- a/src/Object/Api/Mastodon/Preferences.php +++ b/src/Object/Api/Mastodon/Preferences.php @@ -45,10 +45,6 @@ class Preferences extends BaseDataTransferObject /** * Creates a preferences record. * - * @param BaseURL $baseUrl - * @param array $publicContact Full contact table record with uid = 0 - * @param array $apcontact Optional full apcontact table record - * @param array $userContact Optional full contact table record with uid != 0 * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(string $visibility, bool $sensitive, string $language, string $media, bool $spoilers) diff --git a/src/Object/Api/Mastodon/Status/Counts.php b/src/Object/Api/Mastodon/Status/Counts.php index 959c973c5f..a28508d2ea 100644 --- a/src/Object/Api/Mastodon/Status/Counts.php +++ b/src/Object/Api/Mastodon/Status/Counts.php @@ -11,6 +11,11 @@ namespace Friendica\Object\Api\Mastodon\Status; * Class Counts * * @see https://docs.joinmastodon.org/entities/status + * + * @property-read int $replies + * @property-read int $reblogs + * @property-read int $favourites + * @property-read int $dislikes */ class Counts { diff --git a/src/Object/Api/Mastodon/Status/UserAttributes.php b/src/Object/Api/Mastodon/Status/UserAttributes.php index e30961303d..0e7ae09e9d 100644 --- a/src/Object/Api/Mastodon/Status/UserAttributes.php +++ b/src/Object/Api/Mastodon/Status/UserAttributes.php @@ -10,6 +10,12 @@ namespace Friendica\Object\Api\Mastodon\Status; /** * Class UserAttributes * + * @property-read bool $favourited + * @property-read bool $reblogged + * @property-read bool $muted + * @property-read bool $bookmarked + * @property-read bool $pinned + * * @see https://docs.joinmastodon.org/entities/status */ class UserAttributes diff --git a/src/Object/Api/Mastodon/Tag.php b/src/Object/Api/Mastodon/Tag.php index 12851a9131..3c14a5e616 100644 --- a/src/Object/Api/Mastodon/Tag.php +++ b/src/Object/Api/Mastodon/Tag.php @@ -32,7 +32,7 @@ class Tag extends BaseDataTransferObject * @param BaseURL $baseUrl * @param array $tag tag-view record * @param array $history - * @param array $following "true" if the user is following this tag + * @param bool $following "true" if the user is following this tag * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(BaseURL $baseUrl, array $tag, array $history = [], bool $following = false) diff --git a/src/Object/Api/Twitter/Attachment.php b/src/Object/Api/Twitter/Attachment.php index 3e5af7d3cf..8c5bcea305 100644 --- a/src/Object/Api/Twitter/Attachment.php +++ b/src/Object/Api/Twitter/Attachment.php @@ -26,7 +26,6 @@ class Attachment extends BaseDataTransferObject /** * Creates an Attachment entity array * - * @param array $attachment * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(array $media) diff --git a/src/Object/Api/Twitter/Hashtag.php b/src/Object/Api/Twitter/Hashtag.php index 9c8d688025..de8ed71cf6 100644 --- a/src/Object/Api/Twitter/Hashtag.php +++ b/src/Object/Api/Twitter/Hashtag.php @@ -24,7 +24,6 @@ class Hashtag extends BaseDataTransferObject /** * Creates a hashtag * - * @param array $attachment * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(string $name, array $indices) diff --git a/src/Object/Api/Twitter/Media.php b/src/Object/Api/Twitter/Media.php index 3650613c0e..19f98f1a29 100644 --- a/src/Object/Api/Twitter/Media.php +++ b/src/Object/Api/Twitter/Media.php @@ -41,7 +41,6 @@ class Media extends BaseDataTransferObject /** * Creates a media entity array * - * @param array $attachment * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(array $media, string $url, array $indices) diff --git a/src/Object/Api/Twitter/Mention.php b/src/Object/Api/Twitter/Mention.php index 113f682b51..e5d257e9d3 100644 --- a/src/Object/Api/Twitter/Mention.php +++ b/src/Object/Api/Twitter/Mention.php @@ -31,7 +31,6 @@ class Mention extends BaseDataTransferObject /** * Creates a mention record from an tag-view record. * - * @param BaseURL $baseUrl * @param array $tag tag-view record * @param array $contact contact table record * @throws \Friendica\Network\HTTPException\InternalServerErrorException diff --git a/src/Object/Api/Twitter/SavedSearch.php b/src/Object/Api/Twitter/SavedSearch.php index fafb1acec9..28f62f83f4 100644 --- a/src/Object/Api/Twitter/SavedSearch.php +++ b/src/Object/Api/Twitter/SavedSearch.php @@ -34,7 +34,6 @@ class SavedSearch extends BaseDataTransferObject /** * Creates a saved search record from a search record. * - * @param BaseURL $baseUrl * @param array $search Full search table record */ public function __construct(array $search) diff --git a/src/Object/Api/Twitter/Url.php b/src/Object/Api/Twitter/Url.php index f16bec6341..92c2727155 100644 --- a/src/Object/Api/Twitter/Url.php +++ b/src/Object/Api/Twitter/Url.php @@ -28,7 +28,6 @@ class Url extends BaseDataTransferObject /** * Creates an URL entity array * - * @param array $attachment * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public function __construct(array $media, array $indices) 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/Object/Image.php b/src/Object/Image.php index 8a06b37fbd..43b6d91607 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -13,7 +13,7 @@ use Friendica\Util\Images; use Imagick; use ImagickDraw; use ImagickPixel; -use GDImage; +use GdImage; use kornrunner\Blurhash\Blurhash; /** @@ -21,7 +21,7 @@ use kornrunner\Blurhash\Blurhash; */ class Image { - /** @var GDImage|Imagick|resource */ + /** @var GdImage|Imagick|resource */ private $image; /* @@ -41,7 +41,7 @@ class Image * @param string $data Image data * @param string $type optional, default '' * @param string $filename optional, default '' - * @param string $imagick optional, default 'true' + * @param bool $imagick optional, default 'true' * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ @@ -765,7 +765,6 @@ class Image /** * Create a blurhash out of a given image string * - * @param string $img_str * @return string */ public function getBlurHash(): string diff --git a/src/Object/Log/ParsedLogLine.php b/src/Object/Log/ParsedLogLine.php index 0a861c617e..1d9802bb32 100644 --- a/src/Object/Log/ParsedLogLine.php +++ b/src/Object/Log/ParsedLogLine.php @@ -39,7 +39,7 @@ class ParsedLogLine public $logline; /** - * @param int line id + * @param int $id line id * @param string $logline Source log line to parse */ public function __construct(int $id, string $logline) diff --git a/src/Protocol/ATProtocol.php b/src/Protocol/ATProtocol.php index 139453224f..8677b3a92e 100644 --- a/src/Protocol/ATProtocol.php +++ b/src/Protocol/ATProtocol.php @@ -51,7 +51,7 @@ final class ATProtocol /** @var \Friendica\Core\Config\Capability\IManageConfigValues */ private $config; - /** @var IManagePersonalConfigValue */ + /** @var IManagePersonalConfigValues */ private $pConfig; /** @var ICanSendHttpRequests */ diff --git a/src/Protocol/ActivityPub/ClientToServer.php b/src/Protocol/ActivityPub/ClientToServer.php index 4f3a8268b0..989d12bea0 100644 --- a/src/Protocol/ActivityPub/ClientToServer.php +++ b/src/Protocol/ActivityPub/ClientToServer.php @@ -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 diff --git a/src/Protocol/ActivityPub/Fetch.php b/src/Protocol/ActivityPub/Fetch.php index b188c54ec4..fa7b52996b 100644 --- a/src/Protocol/ActivityPub/Fetch.php +++ b/src/Protocol/ActivityPub/Fetch.php @@ -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 { diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 7eeae65ae5..b50397dc75 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -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']]); diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 0aeccc3867..1f03bd2118 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -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']) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 8ea8dfd37a..93b0d7f9ba 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -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); } diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 2e5b7bfdd0..b791c2572f 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -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 diff --git a/src/Protocol/Diaspora/Entity/DiasporaContact.php b/src/Protocol/Diaspora/Entity/DiasporaContact.php index 988f96c34a..2811c7ee5d 100644 --- a/src/Protocol/Diaspora/Entity/DiasporaContact.php +++ b/src/Protocol/Diaspora/Entity/DiasporaContact.php @@ -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 { diff --git a/src/Protocol/Diaspora/Repository/DiasporaContact.php b/src/Protocol/Diaspora/Repository/DiasporaContact.php index 8de645cb52..b680fedea1 100644 --- a/src/Protocol/Diaspora/Repository/DiasporaContact.php +++ b/src/Protocol/Diaspora/Repository/DiasporaContact.php @@ -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 diff --git a/src/Protocol/Email.php b/src/Protocol/Email.php index 765a474773..e44c9a7085 100644 --- a/src/Protocol/Email.php +++ b/src/Protocol/Email.php @@ -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 diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 82227b3b47..da635884d9 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -1146,7 +1146,6 @@ class Feed * @param DOMDocument $doc XML document * @param array $item Data of the item that is to be posted * @param array $owner Contact data of the poster - * @param bool $toplevel Is it for en entry element (false) or a feed entry (true)? * @return DOMElement Entry element * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException @@ -1172,14 +1171,13 @@ class Feed * @param DOMDocument $doc XML document * @param \DOMElement $entry Entry element where the content is added * @param array $item Data of the item that is to be posted - * @param array $owner Contact data of the poster * @param string $title Title for the post * @param string $verb The activity verb * @param bool $complete Add the "status_net" element? - * @return void + * * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - private static function entryContent(DOMDocument $doc, DOMElement $entry, array $item, $title, string $verb = '', bool $complete = true) + private static function entryContent(DOMDocument $doc, DOMElement $entry, array $item, $title, string $verb = '', bool $complete = true): void { if ($verb == '') { $verb = self::constructVerb($item); @@ -1217,11 +1215,10 @@ class Feed * @param object $entry The entry element where the elements are added * @param array $item Data of the item that is to be posted * @param array $owner Contact data of the poster - * @param bool $complete default true - * @return void + * * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - private static function entryFooter(DOMDocument $doc, $entry, array $item, array $owner) + private static function entryFooter(DOMDocument $doc, $entry, array $item, array $owner): void { $mentioned = []; diff --git a/src/Protocol/HTTP/MediaType.php b/src/Protocol/HTTP/MediaType.php index 323c27df10..3c7e3af42a 100644 --- a/src/Protocol/HTTP/MediaType.php +++ b/src/Protocol/HTTP/MediaType.php @@ -35,7 +35,7 @@ final class MediaType private $type; /** - * @var @string + * @var string */ private $subType; diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index 0d6594d714..ec0b0f25f5 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -7,6 +7,7 @@ namespace Friendica\Protocol; +use Exception; use Friendica\Content\Smilies; use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; @@ -299,8 +300,6 @@ class Relay * Return a list of servers that we serve via the direct relay * * @param integer $item_id id of the item that is sent - * @param array $contacts Previously fetched contacts - * @param array $networks Networks of the relay servers * @return array of relay servers * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ diff --git a/src/Security/Authentication.php b/src/Security/Authentication.php index 719873390f..acd3e6d38d 100644 --- a/src/Security/Authentication.php +++ b/src/Security/Authentication.php @@ -220,6 +220,7 @@ class Authentication // Otherwise it's probably an openid. try { $openid = new LightOpenID($this->baseUrl->getHost()); + /** @phpstan-ignore-next-line $openid->identity is private, but will be set via magic setter */ $openid->identity = $openid_url; $this->session->set('openid', $openid_url); $this->session->set('remember', $remember); diff --git a/src/Security/OpenWebAuth.php b/src/Security/OpenWebAuth.php index 4090fa7378..5dd3cf1a27 100644 --- a/src/Security/OpenWebAuth.php +++ b/src/Security/OpenWebAuth.php @@ -15,6 +15,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\OpenWebAuthToken; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Util\HTTPSignature; use Friendica\Util\Network; use Friendica\Util\Strings; diff --git a/src/Security/TwoFactor/Model/TrustedBrowser.php b/src/Security/TwoFactor/Model/TrustedBrowser.php index 64d1a9a975..dccf22d331 100644 --- a/src/Security/TwoFactor/Model/TrustedBrowser.php +++ b/src/Security/TwoFactor/Model/TrustedBrowser.php @@ -14,12 +14,12 @@ use Friendica\Util\DateTimeFormat; * Class TrustedBrowser * * - * @property-read $cookie_hash - * @property-read $uid - * @property-read $user_agent - * @property-read $trusted - * @property-read $created - * @property-read $last_used + * @property-read string $cookie_hash + * @property-read int $uid + * @property-read string $user_agent + * @property-read bool $trusted + * @property-read string $created + * @property-read string|null $last_used * @package Friendica\Model\TwoFactor */ class TrustedBrowser extends BaseEntity diff --git a/src/Security/TwoFactor/Repository/TrustedBrowser.php b/src/Security/TwoFactor/Repository/TrustedBrowser.php index 1dfb2e5f9d..2f5fb5f02b 100644 --- a/src/Security/TwoFactor/Repository/TrustedBrowser.php +++ b/src/Security/TwoFactor/Repository/TrustedBrowser.php @@ -7,10 +7,12 @@ namespace Friendica\Security\TwoFactor\Repository; -use Friendica\Security\TwoFactor; use Friendica\Database\Database; use Friendica\Security\TwoFactor\Exception\TrustedBrowserNotFoundException; use Friendica\Security\TwoFactor\Exception\TrustedBrowserPersistenceException; +use Friendica\Security\TwoFactor\Collection\TrustedBrowsers as TrustedBrowsersCollection; +use Friendica\Security\TwoFactor\Factory\TrustedBrowser as TrustedBrowserFactory; +use Friendica\Security\TwoFactor\Model\TrustedBrowser as TrustedBrowserModel; use Psr\Log\LoggerInterface; class TrustedBrowser @@ -21,27 +23,27 @@ class TrustedBrowser /** @var LoggerInterface */ protected $logger; - /** @var TwoFactor\Factory\TrustedBrowser */ + /** @var TrustedBrowserFactory */ protected $factory; protected static $table_name = '2fa_trusted_browser'; - public function __construct(Database $database, LoggerInterface $logger, TwoFactor\Factory\TrustedBrowser $factory = null) + public function __construct(Database $database, LoggerInterface $logger, TrustedBrowserFactory $factory = null) { $this->db = $database; $this->logger = $logger; - $this->factory = $factory ?? new TwoFactor\Factory\TrustedBrowser($logger); + $this->factory = $factory ?? new TrustedBrowserFactory($logger); } /** * @param string $cookie_hash * - * @return TwoFactor\Model\TrustedBrowser|null + * @return TrustedBrowserModel * * @throws TrustedBrowserPersistenceException * @throws TrustedBrowserNotFoundException */ - public function selectOneByHash(string $cookie_hash): TwoFactor\Model\TrustedBrowser + public function selectOneByHash(string $cookie_hash): TrustedBrowserModel { try { $fields = $this->db->selectFirst(self::$table_name, [], ['cookie_hash' => $cookie_hash]); @@ -56,13 +58,9 @@ class TrustedBrowser } /** - * @param int $uid - * - * @return TwoFactor\Collection\TrustedBrowsers - * * @throws TrustedBrowserPersistenceException */ - public function selectAllByUid(int $uid): TwoFactor\Collection\TrustedBrowsers + public function selectAllByUid(int $uid): TrustedBrowsersCollection { try { $rows = $this->db->selectToArray(self::$table_name, [], ['uid' => $uid]); @@ -71,7 +69,7 @@ class TrustedBrowser foreach ($rows as $fields) { $trustedBrowsers[] = $this->factory->createFromTableRow($fields); } - return new TwoFactor\Collection\TrustedBrowsers($trustedBrowsers); + return new TrustedBrowsersCollection($trustedBrowsers); } catch (\Exception $exception) { throw new TrustedBrowserPersistenceException(sprintf('selection for uid \'%s\' wasn\'t successful.', $uid)); @@ -79,13 +77,9 @@ class TrustedBrowser } /** - * @param TwoFactor\Model\TrustedBrowser $trustedBrowser - * - * @return bool - * * @throws TrustedBrowserPersistenceException */ - public function save(TwoFactor\Model\TrustedBrowser $trustedBrowser): bool + public function save(TrustedBrowserModel $trustedBrowser): bool { try { return $this->db->insert(self::$table_name, $trustedBrowser->toArray(), $this->db::INSERT_UPDATE); @@ -95,13 +89,9 @@ class TrustedBrowser } /** - * @param TwoFactor\Model\TrustedBrowser $trustedBrowser - * - * @return bool - * * @throws TrustedBrowserPersistenceException */ - public function remove(TwoFactor\Model\TrustedBrowser $trustedBrowser): bool + public function remove(TrustedBrowserModel $trustedBrowser): bool { try { return $this->db->delete(self::$table_name, ['cookie_hash' => $trustedBrowser->cookie_hash]); @@ -111,11 +101,6 @@ class TrustedBrowser } /** - * @param int $local_user - * @param string $cookie_hash - * - * @return bool - * * @throws TrustedBrowserPersistenceException */ public function removeForUser(int $local_user, string $cookie_hash): bool @@ -127,11 +112,6 @@ class TrustedBrowser } } - /** - * @param int $local_user - * - * @return bool - */ public function removeAllForUser(int $local_user): bool { try { 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) { diff --git a/src/Worker/ContactDiscoveryForUser.php b/src/Worker/ContactDiscoveryForUser.php index 9fc71b3223..22eb053df6 100644 --- a/src/Worker/ContactDiscoveryForUser.php +++ b/src/Worker/ContactDiscoveryForUser.php @@ -13,7 +13,6 @@ class ContactDiscoveryForUser { /** * Discover contact relations - * @param string $url */ public static function execute(int $uid) { diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 42868e4e0e..7681daf4a5 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -7,6 +7,7 @@ namespace Friendica\Worker; +use Exception; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; @@ -21,6 +22,7 @@ use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Protocol\Activity; use Friendica\Protocol\ActivityPub; use Friendica\Protocol\ActivityPub\Transmitter; diff --git a/src/Worker/UpdateServerPeers.php b/src/Worker/UpdateServerPeers.php index 9c5cce731b..94e04a240d 100644 --- a/src/Worker/UpdateServerPeers.php +++ b/src/Worker/UpdateServerPeers.php @@ -23,7 +23,7 @@ class UpdateServerPeers /** * Query the given server for their known peers * - * @param string $gserver Server URL + * @param string $url Server URL * @return void */ public static function execute(string $url) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 3c9ed127ff..ab112b623b 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2024.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-02 19:01+0000\n" +"POT-Creation-Date: 2024-12-07 15:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,7 @@ msgid "Item not found." msgstr "" #: mod/item.php:448 mod/message.php:54 mod/message.php:100 mod/notes.php:34 -#: mod/photos.php:133 mod/photos.php:625 src/Model/Event.php:506 +#: mod/photos.php:133 mod/photos.php:625 src/Model/Event.php:508 #: src/Module/Attach.php:41 src/Module/BaseApi.php:91 #: src/Module/BaseNotifications.php:83 src/Module/BaseSettings.php:38 #: src/Module/Calendar/Event/API.php:75 src/Module/Calendar/Event/Form.php:70 @@ -271,7 +271,7 @@ msgstr "" msgid "Your message:" msgstr "" -#: mod/message.php:186 mod/message.php:341 src/Content/Conversation.php:357 +#: mod/message.php:186 mod/message.php:341 src/Content/Conversation.php:358 #: src/Module/Post/Edit.php:122 msgid "Upload photo" msgstr "" @@ -281,7 +281,7 @@ msgid "Insert web link" msgstr "" #: mod/message.php:188 mod/message.php:344 mod/photos.php:1253 -#: src/Content/Conversation.php:388 src/Content/Conversation.php:1564 +#: src/Content/Conversation.php:389 src/Content/Conversation.php:1565 #: src/Module/Item/Compose.php:202 src/Module/Post/Edit.php:136 #: src/Object/Post.php:604 msgid "Please wait" @@ -376,7 +376,7 @@ msgid "Save" msgstr "" #: mod/photos.php:52 mod/photos.php:115 mod/photos.php:535 -#: src/Model/Event.php:498 src/Model/Profile.php:212 +#: src/Model/Event.php:500 src/Model/Profile.php:212 #: src/Module/Calendar/Export.php:60 src/Module/Calendar/Show.php:63 #: src/Module/Feed.php:52 src/Module/HCard.php:37 #: src/Module/Profile/Common.php:50 src/Module/Profile/Common.php:59 @@ -467,7 +467,7 @@ msgstr "" msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:688 mod/photos.php:1049 src/Content/Conversation.php:390 +#: mod/photos.php:688 mod/photos.php:1049 src/Content/Conversation.php:391 #: src/Module/Calendar/Event/Form.php:239 src/Module/Post/Edit.php:174 msgid "Permissions" msgstr "" @@ -480,7 +480,7 @@ msgstr "" msgid "Delete Album" msgstr "" -#: mod/photos.php:755 mod/photos.php:855 src/Content/Conversation.php:405 +#: mod/photos.php:755 mod/photos.php:855 src/Content/Conversation.php:406 #: src/Module/Contact/Follow.php:158 src/Module/Contact/Revoke.php:92 #: src/Module/Contact/Unfollow.php:112 #: src/Module/Media/Attachment/Browser.php:64 @@ -599,23 +599,23 @@ msgid "Comment" msgstr "" #: mod/photos.php:1095 mod/photos.php:1151 mod/photos.php:1231 -#: src/Content/Conversation.php:402 src/Module/Calendar/Event/Form.php:234 +#: src/Content/Conversation.php:403 src/Module/Calendar/Event/Form.php:234 #: src/Module/Item/Compose.php:197 src/Module/Post/Edit.php:156 #: src/Object/Post.php:1158 msgid "Preview" msgstr "" -#: mod/photos.php:1096 src/Content/Conversation.php:356 +#: mod/photos.php:1096 src/Content/Conversation.php:357 #: src/Module/Post/Edit.php:121 src/Object/Post.php:1146 msgid "Loading..." msgstr "" -#: mod/photos.php:1188 src/Content/Conversation.php:1486 +#: mod/photos.php:1188 src/Content/Conversation.php:1487 #: src/Object/Post.php:260 msgid "Select" msgstr "" -#: mod/photos.php:1189 src/Content/Conversation.php:1487 +#: mod/photos.php:1189 src/Content/Conversation.php:1488 #: src/Module/Moderation/Users/Active.php:125 #: src/Module/Moderation/Users/Blocked.php:125 #: src/Module/Moderation/Users/Index.php:140 @@ -772,7 +772,7 @@ msgid "All contacts" msgstr "" #: src/BaseModule.php:425 src/Content/Conversation/Factory/Channel.php:32 -#: src/Content/Widget.php:254 src/Core/ACL.php:181 src/Module/Contact.php:395 +#: src/Content/Widget.php:254 src/Core/ACL.php:182 src/Module/Contact.php:395 #: src/Module/Privacy/PermissionTooltip.php:150 #: src/Module/Privacy/PermissionTooltip.php:172 #: src/Module/Settings/Channels.php:146 @@ -813,7 +813,7 @@ msgstr "" msgid "The contact entries have been archived" msgstr "" -#: src/Console/ClearAvatarCache.php:73 +#: src/Console/ClearAvatarCache.php:74 msgid "The avatar cache needs to be disabled in local.config.php to use this command." msgstr "" @@ -888,31 +888,31 @@ msgstr "" msgid " - done" msgstr "" -#: src/Console/MoveToAvatarCache.php:76 +#: src/Console/MoveToAvatarCache.php:77 msgid "The avatar cache needs to be enabled to use this command." msgstr "" -#: src/Console/MoveToAvatarCache.php:94 +#: src/Console/MoveToAvatarCache.php:95 #, php-format msgid "no resource in photo %s" msgstr "" -#: src/Console/MoveToAvatarCache.php:126 +#: src/Console/MoveToAvatarCache.php:127 #, php-format msgid "no photo with id %s" msgstr "" -#: src/Console/MoveToAvatarCache.php:135 +#: src/Console/MoveToAvatarCache.php:136 #, php-format msgid "no image data for photo with id %s" msgstr "" -#: src/Console/MoveToAvatarCache.php:144 +#: src/Console/MoveToAvatarCache.php:145 #, php-format msgid "invalid image for id %s" msgstr "" -#: src/Console/MoveToAvatarCache.php:157 +#: src/Console/MoveToAvatarCache.php:158 #, php-format msgid "Quit on invalid photo %s" msgstr "" @@ -942,7 +942,7 @@ msgstr "" msgid "Enter user nickname: " msgstr "" -#: src/Console/User.php:168 src/Model/User.php:831 +#: src/Console/User.php:168 src/Model/User.php:830 #: src/Module/Api/Twitter/ContactEndpoint.php:62 #: src/Module/Moderation/Users/Active.php:55 #: src/Module/Moderation/Users/Active.php:61 @@ -1045,19 +1045,19 @@ msgstr "" msgid "Monthly" msgstr "" -#: src/Content/ContactSelector.php:118 +#: src/Content/ContactSelector.php:117 msgid "DFRN" msgstr "" -#: src/Content/ContactSelector.php:119 +#: src/Content/ContactSelector.php:118 msgid "OStatus" msgstr "" -#: src/Content/ContactSelector.php:120 +#: src/Content/ContactSelector.php:119 msgid "RSS/Atom" msgstr "" -#: src/Content/ContactSelector.php:121 +#: src/Content/ContactSelector.php:120 #: src/Module/Moderation/Users/Active.php:115 #: src/Module/Moderation/Users/Blocked.php:115 #: src/Module/Moderation/Users/Create.php:58 @@ -1068,439 +1068,439 @@ msgstr "" msgid "Email" msgstr "" -#: src/Content/ContactSelector.php:122 src/Module/Debug/Babel.php:273 +#: src/Content/ContactSelector.php:121 src/Module/Debug/Babel.php:273 msgid "Diaspora" msgstr "" -#: src/Content/ContactSelector.php:123 +#: src/Content/ContactSelector.php:122 msgid "Zot!" msgstr "" -#: src/Content/ContactSelector.php:124 +#: src/Content/ContactSelector.php:123 msgid "LinkedIn" msgstr "" -#: src/Content/ContactSelector.php:125 +#: src/Content/ContactSelector.php:124 msgid "XMPP/IM" msgstr "" -#: src/Content/ContactSelector.php:126 +#: src/Content/ContactSelector.php:125 msgid "MySpace" msgstr "" -#: src/Content/ContactSelector.php:127 +#: src/Content/ContactSelector.php:126 msgid "Google+" msgstr "" -#: src/Content/ContactSelector.php:128 +#: src/Content/ContactSelector.php:127 msgid "pump.io" msgstr "" -#: src/Content/ContactSelector.php:129 +#: src/Content/ContactSelector.php:128 msgid "Twitter" msgstr "" -#: src/Content/ContactSelector.php:130 +#: src/Content/ContactSelector.php:129 msgid "Discourse" msgstr "" -#: src/Content/ContactSelector.php:131 +#: src/Content/ContactSelector.php:130 msgid "Diaspora Connector" msgstr "" -#: src/Content/ContactSelector.php:132 +#: src/Content/ContactSelector.php:131 msgid "GNU Social Connector" msgstr "" -#: src/Content/ContactSelector.php:133 +#: src/Content/ContactSelector.php:132 msgid "ActivityPub" msgstr "" -#: src/Content/ContactSelector.php:134 +#: src/Content/ContactSelector.php:133 msgid "pnut" msgstr "" -#: src/Content/ContactSelector.php:135 +#: src/Content/ContactSelector.php:134 msgid "Tumblr" msgstr "" -#: src/Content/ContactSelector.php:136 +#: src/Content/ContactSelector.php:135 msgid "Bluesky" msgstr "" -#: src/Content/ContactSelector.php:162 +#: src/Content/ContactSelector.php:161 #, php-format msgid "%s (via %s)" msgstr "" -#: src/Content/Conversation.php:214 +#: src/Content/Conversation.php:215 msgid "and" msgstr "" -#: src/Content/Conversation.php:217 +#: src/Content/Conversation.php:218 #, php-format msgid "and %d other people" msgstr "" -#: src/Content/Conversation.php:223 +#: src/Content/Conversation.php:224 #, php-format msgid "%2$s likes this." msgid_plural "%2$s like this." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:225 +#: src/Content/Conversation.php:226 #, php-format msgid "%2$s doesn't like this." msgid_plural "%2$s don't like this." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:227 +#: src/Content/Conversation.php:228 #, php-format msgid "%2$s attends." msgid_plural "%2$s attend." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:229 +#: src/Content/Conversation.php:230 #, php-format msgid "%2$s doesn't attend." msgid_plural "%2$s don't attend." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:231 +#: src/Content/Conversation.php:232 #, php-format msgid "%2$s attends maybe." msgid_plural "%2$s attend maybe." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:233 +#: src/Content/Conversation.php:234 #, php-format msgid "%2$s reshared this." msgid_plural "%2$s reshared this." msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:264 +#: src/Content/Conversation.php:265 #, php-format msgid " likes this" msgid_plural " like this" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:267 +#: src/Content/Conversation.php:268 #, php-format msgid " doesn't like this" msgid_plural " don't like this" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:270 +#: src/Content/Conversation.php:271 #, php-format msgid " attends" msgid_plural " attend" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:273 +#: src/Content/Conversation.php:274 #, php-format msgid " doesn't attend" msgid_plural " don't attend" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:276 +#: src/Content/Conversation.php:277 #, php-format msgid " attends maybe" msgid_plural " attend maybe" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:279 +#: src/Content/Conversation.php:280 #, php-format msgid " reshared this" msgid_plural " reshared this" msgstr[0] "" msgstr[1] "" -#: src/Content/Conversation.php:325 +#: src/Content/Conversation.php:326 msgid "Visible to everybody" msgstr "" -#: src/Content/Conversation.php:326 src/Module/Item/Compose.php:196 +#: src/Content/Conversation.php:327 src/Module/Item/Compose.php:196 #: src/Object/Post.php:1157 msgid "Please enter a image/video/audio/webpage URL:" msgstr "" -#: src/Content/Conversation.php:327 +#: src/Content/Conversation.php:328 msgid "Tag term:" msgstr "" -#: src/Content/Conversation.php:328 src/Module/Filer/SaveTag.php:59 +#: src/Content/Conversation.php:329 src/Module/Filer/SaveTag.php:59 msgid "Save to Folder:" msgstr "" -#: src/Content/Conversation.php:329 +#: src/Content/Conversation.php:330 msgid "Where are you right now?" msgstr "" -#: src/Content/Conversation.php:330 +#: src/Content/Conversation.php:331 msgid "Delete item(s)?" msgstr "" -#: src/Content/Conversation.php:342 src/Module/Item/Compose.php:171 +#: src/Content/Conversation.php:343 src/Module/Item/Compose.php:171 msgid "Created at" msgstr "" -#: src/Content/Conversation.php:352 +#: src/Content/Conversation.php:353 msgid "New Post" msgstr "" -#: src/Content/Conversation.php:355 +#: src/Content/Conversation.php:356 msgid "Share" msgstr "" -#: src/Content/Conversation.php:358 src/Module/Post/Edit.php:123 +#: src/Content/Conversation.php:359 src/Module/Post/Edit.php:123 msgid "upload photo" msgstr "" -#: src/Content/Conversation.php:359 src/Module/Post/Edit.php:124 +#: src/Content/Conversation.php:360 src/Module/Post/Edit.php:124 msgid "Attach file" msgstr "" -#: src/Content/Conversation.php:360 src/Module/Post/Edit.php:125 +#: src/Content/Conversation.php:361 src/Module/Post/Edit.php:125 msgid "attach file" msgstr "" -#: src/Content/Conversation.php:361 src/Module/Item/Compose.php:186 +#: src/Content/Conversation.php:362 src/Module/Item/Compose.php:186 #: src/Module/Post/Edit.php:162 src/Object/Post.php:1147 msgid "Bold" msgstr "" -#: src/Content/Conversation.php:362 src/Module/Item/Compose.php:187 +#: src/Content/Conversation.php:363 src/Module/Item/Compose.php:187 #: src/Module/Post/Edit.php:163 src/Object/Post.php:1148 msgid "Italic" msgstr "" -#: src/Content/Conversation.php:363 src/Module/Item/Compose.php:188 +#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:188 #: src/Module/Post/Edit.php:164 src/Object/Post.php:1149 msgid "Underline" msgstr "" -#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:189 +#: src/Content/Conversation.php:365 src/Module/Item/Compose.php:189 #: src/Module/Post/Edit.php:165 src/Object/Post.php:1151 msgid "Quote" msgstr "" -#: src/Content/Conversation.php:365 src/Module/Item/Compose.php:190 +#: src/Content/Conversation.php:366 src/Module/Item/Compose.php:190 #: src/Module/Post/Edit.php:166 src/Object/Post.php:1152 msgid "Add emojis" msgstr "" -#: src/Content/Conversation.php:366 src/Module/Item/Compose.php:191 +#: src/Content/Conversation.php:367 src/Module/Item/Compose.php:191 #: src/Object/Post.php:1150 msgid "Content Warning" msgstr "" -#: src/Content/Conversation.php:367 src/Module/Item/Compose.php:192 +#: src/Content/Conversation.php:368 src/Module/Item/Compose.php:192 #: src/Module/Post/Edit.php:167 src/Object/Post.php:1153 msgid "Code" msgstr "" -#: src/Content/Conversation.php:368 src/Module/Item/Compose.php:193 +#: src/Content/Conversation.php:369 src/Module/Item/Compose.php:193 #: src/Object/Post.php:1154 msgid "Image" msgstr "" -#: src/Content/Conversation.php:369 src/Module/Item/Compose.php:194 +#: src/Content/Conversation.php:370 src/Module/Item/Compose.php:194 #: src/Module/Post/Edit.php:168 src/Object/Post.php:1155 msgid "Link" msgstr "" -#: src/Content/Conversation.php:370 src/Module/Item/Compose.php:195 +#: src/Content/Conversation.php:371 src/Module/Item/Compose.php:195 #: src/Module/Post/Edit.php:169 src/Object/Post.php:1156 msgid "Link or Media" msgstr "" -#: src/Content/Conversation.php:371 +#: src/Content/Conversation.php:372 msgid "Video" msgstr "" -#: src/Content/Conversation.php:372 src/Module/Item/Compose.php:198 +#: src/Content/Conversation.php:373 src/Module/Item/Compose.php:198 #: src/Module/Post/Edit.php:132 msgid "Set your location" msgstr "" -#: src/Content/Conversation.php:373 src/Module/Post/Edit.php:133 +#: src/Content/Conversation.php:374 src/Module/Post/Edit.php:133 msgid "set location" msgstr "" -#: src/Content/Conversation.php:374 src/Module/Post/Edit.php:134 +#: src/Content/Conversation.php:375 src/Module/Post/Edit.php:134 msgid "Clear browser location" msgstr "" -#: src/Content/Conversation.php:375 src/Module/Post/Edit.php:135 +#: src/Content/Conversation.php:376 src/Module/Post/Edit.php:135 msgid "clear location" msgstr "" -#: src/Content/Conversation.php:377 src/Module/Item/Compose.php:203 +#: src/Content/Conversation.php:378 src/Module/Item/Compose.php:203 #: src/Module/Post/Edit.php:148 msgid "Set title" msgstr "" -#: src/Content/Conversation.php:379 src/Module/Item/Compose.php:204 +#: src/Content/Conversation.php:380 src/Module/Item/Compose.php:204 #: src/Module/Post/Edit.php:150 msgid "Categories (comma-separated list)" msgstr "" -#: src/Content/Conversation.php:384 src/Module/Item/Compose.php:220 +#: src/Content/Conversation.php:385 src/Module/Item/Compose.php:220 msgid "Scheduled at" msgstr "" -#: src/Content/Conversation.php:389 src/Module/Post/Edit.php:137 +#: src/Content/Conversation.php:390 src/Module/Post/Edit.php:137 msgid "Permission settings" msgstr "" -#: src/Content/Conversation.php:398 src/Module/Post/Edit.php:146 +#: src/Content/Conversation.php:399 src/Module/Post/Edit.php:146 msgid "Public post" msgstr "" -#: src/Content/Conversation.php:412 src/Content/Widget/VCard.php:121 +#: src/Content/Conversation.php:413 src/Content/Widget/VCard.php:121 #: src/Model/Profile.php:461 src/Module/Admin/Logs/View.php:80 #: src/Module/Post/Edit.php:172 msgid "Message" msgstr "" -#: src/Content/Conversation.php:413 src/Module/Post/Edit.php:173 +#: src/Content/Conversation.php:414 src/Module/Post/Edit.php:173 #: src/Module/Settings/TwoFactor/Trusted.php:129 msgid "Browser" msgstr "" -#: src/Content/Conversation.php:415 src/Module/Post/Edit.php:176 +#: src/Content/Conversation.php:416 src/Module/Post/Edit.php:176 msgid "Open Compose page" msgstr "" -#: src/Content/Conversation.php:582 +#: src/Content/Conversation.php:583 msgid "remove" msgstr "" -#: src/Content/Conversation.php:586 +#: src/Content/Conversation.php:587 msgid "Delete Selected Items" msgstr "" -#: src/Content/Conversation.php:714 src/Content/Conversation.php:717 -#: src/Content/Conversation.php:720 src/Content/Conversation.php:723 -#: src/Content/Conversation.php:726 +#: src/Content/Conversation.php:715 src/Content/Conversation.php:718 +#: src/Content/Conversation.php:721 src/Content/Conversation.php:724 +#: src/Content/Conversation.php:727 #, php-format msgid "You had been addressed (%s)." msgstr "" -#: src/Content/Conversation.php:729 +#: src/Content/Conversation.php:730 #, php-format msgid "You are following %s." msgstr "" -#: src/Content/Conversation.php:734 +#: src/Content/Conversation.php:735 #, php-format msgid "You subscribed to %s." msgstr "" -#: src/Content/Conversation.php:736 +#: src/Content/Conversation.php:737 msgid "You subscribed to one or more tags in this post." msgstr "" -#: src/Content/Conversation.php:756 +#: src/Content/Conversation.php:757 #, php-format msgid "%s reshared this." msgstr "" -#: src/Content/Conversation.php:758 +#: src/Content/Conversation.php:759 msgid "Reshared" msgstr "" -#: src/Content/Conversation.php:758 +#: src/Content/Conversation.php:759 #, php-format msgid "Reshared by %s <%s>" msgstr "" -#: src/Content/Conversation.php:761 +#: src/Content/Conversation.php:762 #, php-format msgid "%s is participating in this thread." msgstr "" -#: src/Content/Conversation.php:764 +#: src/Content/Conversation.php:765 msgid "Stored for general reasons" msgstr "" -#: src/Content/Conversation.php:767 +#: src/Content/Conversation.php:768 msgid "Global post" msgstr "" -#: src/Content/Conversation.php:770 +#: src/Content/Conversation.php:771 msgid "Sent via an relay server" msgstr "" -#: src/Content/Conversation.php:770 +#: src/Content/Conversation.php:771 #, php-format msgid "Sent via the relay server %s <%s>" msgstr "" -#: src/Content/Conversation.php:773 +#: src/Content/Conversation.php:774 msgid "Fetched" msgstr "" -#: src/Content/Conversation.php:773 +#: src/Content/Conversation.php:774 #, php-format msgid "Fetched because of %s <%s>" msgstr "" -#: src/Content/Conversation.php:776 +#: src/Content/Conversation.php:777 msgid "Stored because of a child post to complete this thread." msgstr "" -#: src/Content/Conversation.php:779 +#: src/Content/Conversation.php:780 msgid "Local delivery" msgstr "" -#: src/Content/Conversation.php:782 +#: src/Content/Conversation.php:783 msgid "Stored because of your activity (like, comment, star, ...)" msgstr "" -#: src/Content/Conversation.php:785 +#: src/Content/Conversation.php:786 msgid "Distributed" msgstr "" -#: src/Content/Conversation.php:788 +#: src/Content/Conversation.php:789 msgid "Pushed to us" msgstr "" -#: src/Content/Conversation.php:1506 src/Object/Post.php:247 +#: src/Content/Conversation.php:1507 src/Object/Post.php:247 msgid "Pinned item" msgstr "" -#: src/Content/Conversation.php:1523 src/Object/Post.php:541 +#: src/Content/Conversation.php:1524 src/Object/Post.php:541 #: src/Object/Post.php:542 #, php-format msgid "View %s's profile @ %s" msgstr "" -#: src/Content/Conversation.php:1537 src/Object/Post.php:529 +#: src/Content/Conversation.php:1538 src/Object/Post.php:529 msgid "Categories:" msgstr "" -#: src/Content/Conversation.php:1538 src/Object/Post.php:530 +#: src/Content/Conversation.php:1539 src/Object/Post.php:530 msgid "Filed under:" msgstr "" -#: src/Content/Conversation.php:1546 src/Object/Post.php:556 +#: src/Content/Conversation.php:1547 src/Object/Post.php:556 #, php-format msgid "%s from %s" msgstr "" -#: src/Content/Conversation.php:1562 +#: src/Content/Conversation.php:1563 msgid "View in context" msgstr "" @@ -1833,57 +1833,57 @@ msgstr "" msgid "Create new group" msgstr "" -#: src/Content/Item.php:320 src/Model/Item.php:3282 +#: src/Content/Item.php:322 src/Model/Item.php:3281 msgid "event" msgstr "" -#: src/Content/Item.php:323 src/Content/Item.php:333 +#: src/Content/Item.php:325 src/Content/Item.php:335 msgid "status" msgstr "" -#: src/Content/Item.php:329 src/Model/Item.php:3284 +#: src/Content/Item.php:331 src/Model/Item.php:3283 #: src/Module/Post/Tag/Add.php:109 msgid "photo" msgstr "" -#: src/Content/Item.php:343 src/Module/Post/Tag/Add.php:127 +#: src/Content/Item.php:345 src/Module/Post/Tag/Add.php:127 #, php-format msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "" -#: src/Content/Item.php:417 view/theme/frio/theme.php:253 +#: src/Content/Item.php:419 view/theme/frio/theme.php:253 msgid "Follow Thread" msgstr "" -#: src/Content/Item.php:418 src/Model/Contact.php:1244 +#: src/Content/Item.php:420 src/Model/Contact.php:1245 msgid "View Status" msgstr "" -#: src/Content/Item.php:419 src/Content/Item.php:442 src/Model/Contact.php:1179 -#: src/Model/Contact.php:1235 src/Model/Contact.php:1245 +#: src/Content/Item.php:421 src/Content/Item.php:444 src/Model/Contact.php:1180 +#: src/Model/Contact.php:1236 src/Model/Contact.php:1246 #: src/Module/Directory.php:143 src/Module/Settings/Profile/Index.php:250 msgid "View Profile" msgstr "" -#: src/Content/Item.php:420 src/Model/Contact.php:1246 +#: src/Content/Item.php:422 src/Model/Contact.php:1247 msgid "View Photos" msgstr "" -#: src/Content/Item.php:421 src/Model/Contact.php:1213 +#: src/Content/Item.php:423 src/Model/Contact.php:1214 #: src/Model/Profile.php:446 msgid "Network Posts" msgstr "" -#: src/Content/Item.php:422 src/Model/Contact.php:1237 -#: src/Model/Contact.php:1248 +#: src/Content/Item.php:424 src/Model/Contact.php:1238 +#: src/Model/Contact.php:1249 msgid "View Contact" msgstr "" -#: src/Content/Item.php:423 src/Model/Contact.php:1249 +#: src/Content/Item.php:425 src/Model/Contact.php:1250 msgid "Send PM" msgstr "" -#: src/Content/Item.php:424 src/Module/Contact.php:449 +#: src/Content/Item.php:426 src/Module/Contact.php:449 #: src/Module/Contact/Profile.php:524 #: src/Module/Moderation/Blocklist/Contact.php:104 #: src/Module/Moderation/Users/Active.php:126 @@ -1891,7 +1891,7 @@ msgstr "" msgid "Block" msgstr "" -#: src/Content/Item.php:425 src/Module/Contact.php:450 +#: src/Content/Item.php:427 src/Module/Contact.php:450 #: src/Module/Contact/Profile.php:532 #: src/Module/Notifications/Introductions.php:126 #: src/Module/Notifications/Introductions.php:199 @@ -1899,32 +1899,32 @@ msgstr "" msgid "Ignore" msgstr "" -#: src/Content/Item.php:426 src/Module/Contact.php:451 +#: src/Content/Item.php:428 src/Module/Contact.php:451 #: src/Module/Contact/Profile.php:540 msgid "Collapse" msgstr "" -#: src/Content/Item.php:427 src/Object/Post.php:288 +#: src/Content/Item.php:429 src/Object/Post.php:288 #, php-format msgid "Ignore %s server" msgstr "" -#: src/Content/Item.php:431 src/Module/Settings/Channels.php:188 +#: src/Content/Item.php:433 src/Module/Settings/Channels.php:188 #: src/Module/Settings/Channels.php:209 src/Object/Post.php:502 msgid "Languages" msgstr "" -#: src/Content/Item.php:434 src/Object/Post.php:582 +#: src/Content/Item.php:436 src/Object/Post.php:582 msgid "Search Text" msgstr "" -#: src/Content/Item.php:439 src/Content/Widget.php:66 -#: src/Model/Contact.php:1238 src/Model/Contact.php:1250 +#: src/Content/Item.php:441 src/Content/Widget.php:66 +#: src/Model/Contact.php:1239 src/Model/Contact.php:1251 #: src/Module/Contact/Follow.php:152 view/theme/vier/theme.php:183 msgid "Connect/Follow" msgstr "" -#: src/Content/Item.php:873 +#: src/Content/Item.php:870 msgid "Unable to fetch user." msgstr "" @@ -1932,7 +1932,7 @@ msgstr "" msgid "Nothing new here" msgstr "" -#: src/Content/Nav.php:111 src/Module/Special/HTTPException.php:63 +#: src/Content/Nav.php:111 src/Module/Special/HTTPException.php:64 msgid "Go back" msgstr "" @@ -2238,33 +2238,33 @@ msgstr "" msgid "last" msgstr "" -#: src/Content/Text/BBCode.php:908 +#: src/Content/Text/BBCode.php:903 #, php-format msgid "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:931 src/Model/Item.php:4081 -#: src/Model/Item.php:4087 src/Model/Item.php:4088 +#: src/Content/Text/BBCode.php:926 src/Model/Item.php:4080 +#: src/Model/Item.php:4086 src/Model/Item.php:4087 msgid "Link to source" msgstr "" -#: src/Content/Text/BBCode.php:1745 src/Content/Text/HTML.php:892 +#: src/Content/Text/BBCode.php:1740 src/Content/Text/HTML.php:892 msgid "Click to open/close" msgstr "" -#: src/Content/Text/BBCode.php:1800 +#: src/Content/Text/BBCode.php:1795 msgid "$1 wrote:" msgstr "" -#: src/Content/Text/BBCode.php:1874 src/Content/Text/BBCode.php:1875 +#: src/Content/Text/BBCode.php:1869 src/Content/Text/BBCode.php:1870 msgid "Encrypted content" msgstr "" -#: src/Content/Text/BBCode.php:2208 +#: src/Content/Text/BBCode.php:2203 msgid "Invalid source protocol" msgstr "" -#: src/Content/Text/BBCode.php:2227 +#: src/Content/Text/BBCode.php:2222 msgid "Invalid link protocol" msgstr "" @@ -2395,7 +2395,7 @@ msgstr "" msgid "Organisations" msgstr "" -#: src/Content/Widget.php:554 src/Model/Contact.php:1750 +#: src/Content/Widget.php:554 src/Model/Contact.php:1751 msgid "News" msgstr "" @@ -2449,12 +2449,12 @@ msgstr[1] "" msgid "More Trending Tags" msgstr "" -#: src/Content/Widget/VCard.php:95 src/Model/Contact.php:1207 +#: src/Content/Widget/VCard.php:95 src/Model/Contact.php:1208 #: src/Model/Profile.php:440 msgid "Post to group" msgstr "" -#: src/Content/Widget/VCard.php:100 src/Model/Contact.php:1211 +#: src/Content/Widget/VCard.php:100 src/Model/Contact.php:1212 #: src/Model/Profile.php:444 src/Module/Moderation/Item/Source.php:80 msgid "Mention" msgstr "" @@ -2469,8 +2469,8 @@ msgstr "" msgid "Matrix:" msgstr "" -#: src/Content/Widget/VCard.php:112 src/Model/Event.php:68 -#: src/Model/Event.php:95 src/Model/Event.php:457 src/Model/Event.php:946 +#: src/Content/Widget/VCard.php:112 src/Model/Event.php:70 +#: src/Model/Event.php:97 src/Model/Event.php:459 src/Model/Event.php:947 #: src/Model/Profile.php:354 src/Module/Contact/Profile.php:418 #: src/Module/Directory.php:133 src/Module/Notifications/Introductions.php:180 #: src/Module/Profile/Profile.php:212 @@ -2482,68 +2482,68 @@ msgstr "" msgid "Network:" msgstr "" -#: src/Content/Widget/VCard.php:119 src/Model/Contact.php:1239 -#: src/Model/Contact.php:1251 src/Model/Profile.php:457 +#: src/Content/Widget/VCard.php:119 src/Model/Contact.php:1240 +#: src/Model/Contact.php:1252 src/Model/Profile.php:457 #: src/Module/Contact/Profile.php:476 msgid "Unfollow" msgstr "" -#: src/Content/Widget/VCard.php:125 src/Model/Contact.php:1209 +#: src/Content/Widget/VCard.php:125 src/Model/Contact.php:1210 #: src/Model/Profile.php:442 msgid "View group" msgstr "" -#: src/Core/ACL.php:152 src/Module/Profile/Profile.php:260 +#: src/Core/ACL.php:153 src/Module/Profile/Profile.php:260 msgid "Yourself" msgstr "" -#: src/Core/ACL.php:188 src/Module/Privacy/PermissionTooltip.php:156 +#: src/Core/ACL.php:189 src/Module/Privacy/PermissionTooltip.php:156 #: src/Module/Privacy/PermissionTooltip.php:178 msgid "Mutuals" msgstr "" -#: src/Core/ACL.php:280 +#: src/Core/ACL.php:281 msgid "Post to Email" msgstr "" -#: src/Core/ACL.php:307 src/Module/Privacy/PermissionTooltip.php:103 +#: src/Core/ACL.php:308 src/Module/Privacy/PermissionTooltip.php:103 #: src/Module/Privacy/PermissionTooltip.php:217 msgid "Public" msgstr "" -#: src/Core/ACL.php:308 +#: src/Core/ACL.php:309 msgid "This content will be shown to all your followers and can be seen in the community pages and by anyone with its link." msgstr "" -#: src/Core/ACL.php:309 src/Module/Privacy/PermissionTooltip.php:105 +#: src/Core/ACL.php:310 src/Module/Privacy/PermissionTooltip.php:105 msgid "Limited/Private" msgstr "" -#: src/Core/ACL.php:310 +#: src/Core/ACL.php:311 msgid "This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won't appear anywhere public." msgstr "" -#: src/Core/ACL.php:310 +#: src/Core/ACL.php:311 msgid "Start typing the name of a contact or a circle to show a filtered list. You can also mention the special circles \"Followers\" and \"Mutuals\"." msgstr "" -#: src/Core/ACL.php:311 +#: src/Core/ACL.php:312 msgid "Show to:" msgstr "" -#: src/Core/ACL.php:312 +#: src/Core/ACL.php:313 msgid "Except to:" msgstr "" -#: src/Core/ACL.php:313 src/Module/Post/Edit.php:145 +#: src/Core/ACL.php:314 src/Module/Post/Edit.php:145 msgid "CC: email addresses" msgstr "" -#: src/Core/ACL.php:314 src/Module/Post/Edit.php:151 +#: src/Core/ACL.php:315 src/Module/Post/Edit.php:151 msgid "Example: bob@example.com, mary@example.com" msgstr "" -#: src/Core/ACL.php:315 +#: src/Core/ACL.php:316 msgid "Connectors" msgstr "" @@ -2832,176 +2832,176 @@ msgstr "" msgid "Could not connect to database." msgstr "" -#: src/Core/L10n.php:430 src/Model/Item.php:2325 +#: src/Core/L10n.php:426 src/Model/Item.php:2324 msgid "Undetermined" msgstr "" -#: src/Core/L10n.php:437 +#: src/Core/L10n.php:433 #, php-format msgid "%s (%s)" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:416 +#: src/Core/L10n.php:481 src/Model/Event.php:418 #: src/Module/Settings/Display.php:292 msgid "Monday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:417 +#: src/Core/L10n.php:481 src/Model/Event.php:419 #: src/Module/Settings/Display.php:293 msgid "Tuesday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:418 +#: src/Core/L10n.php:481 src/Model/Event.php:420 #: src/Module/Settings/Display.php:294 msgid "Wednesday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:419 +#: src/Core/L10n.php:481 src/Model/Event.php:421 #: src/Module/Settings/Display.php:295 msgid "Thursday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:420 +#: src/Core/L10n.php:481 src/Model/Event.php:422 #: src/Module/Settings/Display.php:296 msgid "Friday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:421 +#: src/Core/L10n.php:481 src/Model/Event.php:423 #: src/Module/Settings/Display.php:297 msgid "Saturday" msgstr "" -#: src/Core/L10n.php:485 src/Model/Event.php:415 +#: src/Core/L10n.php:481 src/Model/Event.php:417 #: src/Module/Settings/Display.php:291 msgid "Sunday" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:436 +#: src/Core/L10n.php:485 src/Model/Event.php:438 msgid "January" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:437 +#: src/Core/L10n.php:485 src/Model/Event.php:439 msgid "February" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:438 +#: src/Core/L10n.php:485 src/Model/Event.php:440 msgid "March" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:439 +#: src/Core/L10n.php:485 src/Model/Event.php:441 msgid "April" msgstr "" -#: src/Core/L10n.php:489 src/Core/L10n.php:508 src/Model/Event.php:427 +#: src/Core/L10n.php:485 src/Core/L10n.php:504 src/Model/Event.php:429 msgid "May" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:440 +#: src/Core/L10n.php:485 src/Model/Event.php:442 msgid "June" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:441 +#: src/Core/L10n.php:485 src/Model/Event.php:443 msgid "July" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:442 +#: src/Core/L10n.php:485 src/Model/Event.php:444 msgid "August" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:443 +#: src/Core/L10n.php:485 src/Model/Event.php:445 msgid "September" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:444 +#: src/Core/L10n.php:485 src/Model/Event.php:446 msgid "October" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:445 +#: src/Core/L10n.php:485 src/Model/Event.php:447 msgid "November" msgstr "" -#: src/Core/L10n.php:489 src/Model/Event.php:446 +#: src/Core/L10n.php:485 src/Model/Event.php:448 msgid "December" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:408 +#: src/Core/L10n.php:500 src/Model/Event.php:410 msgid "Mon" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:409 +#: src/Core/L10n.php:500 src/Model/Event.php:411 msgid "Tue" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:410 +#: src/Core/L10n.php:500 src/Model/Event.php:412 msgid "Wed" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:411 +#: src/Core/L10n.php:500 src/Model/Event.php:413 msgid "Thu" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:412 +#: src/Core/L10n.php:500 src/Model/Event.php:414 msgid "Fri" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:413 +#: src/Core/L10n.php:500 src/Model/Event.php:415 msgid "Sat" msgstr "" -#: src/Core/L10n.php:504 src/Model/Event.php:407 +#: src/Core/L10n.php:500 src/Model/Event.php:409 msgid "Sun" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:423 +#: src/Core/L10n.php:504 src/Model/Event.php:425 msgid "Jan" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:424 +#: src/Core/L10n.php:504 src/Model/Event.php:426 msgid "Feb" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:425 +#: src/Core/L10n.php:504 src/Model/Event.php:427 msgid "Mar" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:426 +#: src/Core/L10n.php:504 src/Model/Event.php:428 msgid "Apr" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:428 +#: src/Core/L10n.php:504 src/Model/Event.php:430 msgid "Jun" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:429 +#: src/Core/L10n.php:504 src/Model/Event.php:431 msgid "Jul" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:430 +#: src/Core/L10n.php:504 src/Model/Event.php:432 msgid "Aug" msgstr "" -#: src/Core/L10n.php:508 +#: src/Core/L10n.php:504 msgid "Sep" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:432 +#: src/Core/L10n.php:504 src/Model/Event.php:434 msgid "Oct" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:433 +#: src/Core/L10n.php:504 src/Model/Event.php:435 msgid "Nov" msgstr "" -#: src/Core/L10n.php:508 src/Model/Event.php:434 +#: src/Core/L10n.php:504 src/Model/Event.php:436 msgid "Dec" msgstr "" -#: src/Core/Logger/Util/LoggerSettingsCheck.php:46 +#: src/Core/Logger/Util/LoggerSettingsCheck.php:44 #, php-format msgid "The logfile '%s' is not usable. No logging possible (error: '%s')" msgstr "" -#: src/Core/Logger/Util/LoggerSettingsCheck.php:71 +#: src/Core/Logger/Util/LoggerSettingsCheck.php:67 #, php-format msgid "The debug logfile '%s' is not usable. No logging possible (error: '%s')" msgstr "" @@ -3192,274 +3192,274 @@ msgstr "" msgid "Edit circles" msgstr "" -#: src/Model/Contact.php:1258 src/Module/Moderation/Users/Pending.php:88 +#: src/Model/Contact.php:1259 src/Module/Moderation/Users/Pending.php:88 #: src/Module/Notifications/Introductions.php:124 #: src/Module/Notifications/Introductions.php:197 msgid "Approve" msgstr "" -#: src/Model/Contact.php:1594 src/Model/Contact.php:1666 +#: src/Model/Contact.php:1595 src/Model/Contact.php:1667 #: src/Module/Contact/Profile.php:360 #, php-format msgid "%s has blocked you" msgstr "" -#: src/Model/Contact.php:1746 +#: src/Model/Contact.php:1747 msgid "Organisation" msgstr "" -#: src/Model/Contact.php:1754 +#: src/Model/Contact.php:1755 msgid "Group" msgstr "" -#: src/Model/Contact.php:1758 src/Module/Moderation/BaseUsers.php:122 +#: src/Model/Contact.php:1759 src/Module/Moderation/BaseUsers.php:122 msgid "Relay" msgstr "" -#: src/Model/Contact.php:3084 +#: src/Model/Contact.php:3085 msgid "Disallowed profile URL." msgstr "" -#: src/Model/Contact.php:3089 src/Module/Friendica.php:88 +#: src/Model/Contact.php:3090 src/Module/Friendica.php:88 msgid "Blocked domain" msgstr "" -#: src/Model/Contact.php:3094 +#: src/Model/Contact.php:3095 msgid "Connect URL missing." msgstr "" -#: src/Model/Contact.php:3103 +#: src/Model/Contact.php:3104 msgid "The contact could not be added. Please check the relevant network credentials in your Settings -> Social Networks page." msgstr "" -#: src/Model/Contact.php:3121 +#: src/Model/Contact.php:3122 #, php-format msgid "Expected network %s does not match actual network %s" msgstr "" -#: src/Model/Contact.php:3138 +#: src/Model/Contact.php:3139 msgid "This seems to be a relay account. They can't be followed by users." msgstr "" -#: src/Model/Contact.php:3145 +#: src/Model/Contact.php:3146 msgid "The profile address specified does not provide adequate information." msgstr "" -#: src/Model/Contact.php:3147 +#: src/Model/Contact.php:3148 msgid "No compatible communication protocols or feeds were discovered." msgstr "" -#: src/Model/Contact.php:3150 +#: src/Model/Contact.php:3151 msgid "An author or name was not found." msgstr "" -#: src/Model/Contact.php:3153 +#: src/Model/Contact.php:3154 msgid "No browser URL could be matched to this address." msgstr "" -#: src/Model/Contact.php:3156 +#: src/Model/Contact.php:3157 msgid "Unable to match @-style Identity Address with a known protocol or email contact." msgstr "" -#: src/Model/Contact.php:3157 +#: src/Model/Contact.php:3158 msgid "Use mailto: in front of address to force email check." msgstr "" -#: src/Model/Contact.php:3163 +#: src/Model/Contact.php:3164 msgid "Limited profile. This person will be unable to receive direct/personal notifications from you." msgstr "" -#: src/Model/Contact.php:3222 +#: src/Model/Contact.php:3223 msgid "Unable to retrieve contact information." msgstr "" -#: src/Model/Event.php:40 +#: src/Model/Event.php:42 msgid "l F d, Y \\@ g:i A \\G\\M\\TP (e)" msgstr "" -#: src/Model/Event.php:61 src/Model/Event.php:78 src/Model/Event.php:455 -#: src/Model/Event.php:928 +#: src/Model/Event.php:63 src/Model/Event.php:80 src/Model/Event.php:457 +#: src/Model/Event.php:929 msgid "Starts:" msgstr "" -#: src/Model/Event.php:64 src/Model/Event.php:84 src/Model/Event.php:456 -#: src/Model/Event.php:932 +#: src/Model/Event.php:66 src/Model/Event.php:86 src/Model/Event.php:458 +#: src/Model/Event.php:933 msgid "Finishes:" msgstr "" -#: src/Model/Event.php:405 +#: src/Model/Event.php:407 msgid "all-day" msgstr "" -#: src/Model/Event.php:431 +#: src/Model/Event.php:433 msgid "Sept" msgstr "" -#: src/Model/Event.php:448 src/Module/Calendar/Show.php:117 +#: src/Model/Event.php:450 src/Module/Calendar/Show.php:117 #: src/Util/Temporal.php:329 msgid "today" msgstr "" -#: src/Model/Event.php:449 src/Module/Calendar/Show.php:118 +#: src/Model/Event.php:451 src/Module/Calendar/Show.php:118 #: src/Module/Settings/Display.php:302 src/Util/Temporal.php:339 msgid "month" msgstr "" -#: src/Model/Event.php:450 src/Module/Calendar/Show.php:119 +#: src/Model/Event.php:452 src/Module/Calendar/Show.php:119 #: src/Module/Settings/Display.php:303 src/Util/Temporal.php:340 msgid "week" msgstr "" -#: src/Model/Event.php:451 src/Module/Calendar/Show.php:120 +#: src/Model/Event.php:453 src/Module/Calendar/Show.php:120 #: src/Module/Settings/Display.php:304 src/Util/Temporal.php:341 msgid "day" msgstr "" -#: src/Model/Event.php:453 +#: src/Model/Event.php:455 msgid "No events to display" msgstr "" -#: src/Model/Event.php:502 src/Module/Feed.php:56 +#: src/Model/Event.php:504 src/Module/Feed.php:56 #: src/Module/Update/Profile.php:42 msgid "Access to this profile has been restricted." msgstr "" -#: src/Model/Event.php:544 src/Module/Calendar/Event/Show.php:52 +#: src/Model/Event.php:545 src/Module/Calendar/Event/Show.php:52 msgid "Event not found." msgstr "" -#: src/Model/Event.php:623 +#: src/Model/Event.php:624 msgid "l, F j" msgstr "" -#: src/Model/Event.php:650 +#: src/Model/Event.php:651 msgid "Edit event" msgstr "" -#: src/Model/Event.php:651 +#: src/Model/Event.php:652 msgid "Duplicate event" msgstr "" -#: src/Model/Event.php:652 +#: src/Model/Event.php:653 msgid "Delete event" msgstr "" -#: src/Model/Event.php:882 src/Module/Debug/Localtime.php:24 +#: src/Model/Event.php:883 src/Module/Debug/Localtime.php:24 msgid "l F d, Y \\@ g:i A" msgstr "" -#: src/Model/Event.php:883 +#: src/Model/Event.php:884 msgid "D g:i A" msgstr "" -#: src/Model/Event.php:884 +#: src/Model/Event.php:885 msgid "g:i A" msgstr "" -#: src/Model/Event.php:947 src/Model/Event.php:949 +#: src/Model/Event.php:948 src/Model/Event.php:950 msgid "Show map" msgstr "" -#: src/Model/Event.php:948 +#: src/Model/Event.php:949 msgid "Hide map" msgstr "" -#: src/Model/Event.php:1041 -#, php-format -msgid "%s's birthday" -msgstr "" - #: src/Model/Event.php:1042 #, php-format +msgid "%s's birthday" +msgstr "" + +#: src/Model/Event.php:1043 +#, php-format msgid "Happy Birthday %s" msgstr "" -#: src/Model/Item.php:2332 +#: src/Model/Item.php:2331 #, php-format msgid "%s (%s - %s): %s" msgstr "" -#: src/Model/Item.php:2334 +#: src/Model/Item.php:2333 #, php-format msgid "%s (%s): %s" msgstr "" -#: src/Model/Item.php:2337 +#: src/Model/Item.php:2336 #, php-format msgid "" "Detected languages in this post:\n" "%s" msgstr "" -#: src/Model/Item.php:3286 +#: src/Model/Item.php:3285 msgid "activity" msgstr "" -#: src/Model/Item.php:3288 +#: src/Model/Item.php:3287 msgid "comment" msgstr "" -#: src/Model/Item.php:3291 src/Module/Post/Tag/Add.php:109 +#: src/Model/Item.php:3290 src/Module/Post/Tag/Add.php:109 msgid "post" msgstr "" -#: src/Model/Item.php:3464 +#: src/Model/Item.php:3463 #, php-format msgid "%s is blocked" msgstr "" -#: src/Model/Item.php:3466 +#: src/Model/Item.php:3465 #, php-format msgid "%s is ignored" msgstr "" -#: src/Model/Item.php:3468 +#: src/Model/Item.php:3467 #, php-format msgid "Content from %s is collapsed" msgstr "" -#: src/Model/Item.php:3472 +#: src/Model/Item.php:3471 msgid "Sensitive content" msgstr "" -#: src/Model/Item.php:3981 +#: src/Model/Item.php:3980 msgid "bytes" msgstr "" -#: src/Model/Item.php:4012 +#: src/Model/Item.php:4011 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:4014 +#: src/Model/Item.php:4013 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:4019 +#: src/Model/Item.php:4018 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:4021 +#: src/Model/Item.php:4020 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:4023 +#: src/Model/Item.php:4022 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:4064 src/Model/Item.php:4065 +#: src/Model/Item.php:4063 src/Model/Item.php:4064 msgid "View on separate page" msgstr "" @@ -3467,7 +3467,7 @@ msgstr "" msgid "[no subject]" msgstr "" -#: src/Model/Photo.php:1194 src/Module/Media/Photo/Upload.php:154 +#: src/Model/Photo.php:1191 src/Module/Media/Photo/Upload.php:154 msgid "Wall Photos" msgstr "" @@ -3570,7 +3570,7 @@ msgstr "" msgid "Title/Description:" msgstr "" -#: src/Model/Profile.php:796 src/Module/Admin/Summary.php:176 +#: src/Model/Profile.php:796 src/Module/Admin/Summary.php:174 #: src/Module/Moderation/Report/Create.php:266 #: src/Module/Moderation/Summary.php:65 msgid "Summary" @@ -3621,55 +3621,55 @@ msgstr "" msgid "SERIOUS ERROR: Generation of security keys failed." msgstr "" -#: src/Model/User.php:740 src/Model/User.php:773 +#: src/Model/User.php:739 src/Model/User.php:772 msgid "Login failed" msgstr "" -#: src/Model/User.php:805 +#: src/Model/User.php:804 msgid "Not enough information to authenticate" msgstr "" -#: src/Model/User.php:930 +#: src/Model/User.php:929 msgid "Password can't be empty" msgstr "" -#: src/Model/User.php:972 +#: src/Model/User.php:971 msgid "Empty passwords are not allowed." msgstr "" -#: src/Model/User.php:976 +#: src/Model/User.php:975 msgid "The new password has been exposed in a public data dump, please choose another." msgstr "" -#: src/Model/User.php:980 +#: src/Model/User.php:979 msgid "The password length is limited to 72 characters." msgstr "" -#: src/Model/User.php:984 +#: src/Model/User.php:983 msgid "The password can't contain white spaces nor accentuated letters" msgstr "" -#: src/Model/User.php:1193 +#: src/Model/User.php:1192 msgid "Passwords do not match. Password unchanged." msgstr "" -#: src/Model/User.php:1200 +#: src/Model/User.php:1199 msgid "An invitation is required." msgstr "" -#: src/Model/User.php:1204 +#: src/Model/User.php:1203 msgid "Invitation could not be verified." msgstr "" -#: src/Model/User.php:1212 +#: src/Model/User.php:1211 msgid "Invalid OpenID url" msgstr "" -#: src/Model/User.php:1225 src/Security/Authentication.php:230 +#: src/Model/User.php:1225 src/Security/Authentication.php:231 msgid "We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID." msgstr "" -#: src/Model/User.php:1225 src/Security/Authentication.php:230 +#: src/Model/User.php:1225 src/Security/Authentication.php:231 msgid "The error message was:" msgstr "" @@ -3884,7 +3884,7 @@ msgstr "" #: src/Module/Admin/Federation.php:213 src/Module/Admin/Logs/Settings.php:74 #: src/Module/Admin/Logs/View.php:71 src/Module/Admin/Queue.php:59 #: src/Module/Admin/Site.php:447 src/Module/Admin/Storage.php:124 -#: src/Module/Admin/Summary.php:175 src/Module/Admin/Themes/Details.php:82 +#: src/Module/Admin/Summary.php:173 src/Module/Admin/Themes/Details.php:82 #: src/Module/Admin/Themes/Index.php:103 src/Module/Admin/Tos.php:63 #: src/Module/Moderation/Users/Create.php:47 #: src/Module/Moderation/Users/Pending.php:82 @@ -5343,95 +5343,95 @@ msgstr "" msgid "Database (legacy)" msgstr "" -#: src/Module/Admin/Summary.php:41 +#: src/Module/Admin/Summary.php:39 #, php-format msgid "Template engine (%s) error: %s" msgstr "" -#: src/Module/Admin/Summary.php:45 +#: src/Module/Admin/Summary.php:43 #, php-format msgid "Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See here for a guide that may be helpful converting the table engines. You may also use the command php bin/console.php dbstructure toinnodb of your Friendica installation for an automatic conversion.
" msgstr "" -#: src/Module/Admin/Summary.php:50 +#: src/Module/Admin/Summary.php:48 #, php-format msgid "Your DB still runs with InnoDB tables in the Antelope file format. You should change the file format to Barracuda. Friendica is using features that are not provided by the Antelope format. See here for a guide that may be helpful converting the table engines. You may also use the command php bin/console.php dbstructure toinnodb of your Friendica installation for an automatic conversion.
" msgstr "" -#: src/Module/Admin/Summary.php:60 +#: src/Module/Admin/Summary.php:58 #, php-format msgid "Your table_definition_cache is too low (%d). This can lead to the database error \"Prepared statement needs to be re-prepared\". Please set it at least to %d. See here for more information.
" msgstr "" -#: src/Module/Admin/Summary.php:68 +#: src/Module/Admin/Summary.php:66 #, php-format msgid "There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s" msgstr "" -#: src/Module/Admin/Summary.php:76 +#: src/Module/Admin/Summary.php:74 msgid "The database update failed. Please run \"php bin/console.php dbstructure update\" from the command line and have a look at the errors that might appear." msgstr "" -#: src/Module/Admin/Summary.php:80 +#: src/Module/Admin/Summary.php:78 msgid "The last update failed. Please run \"php bin/console.php dbstructure update\" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)" msgstr "" -#: src/Module/Admin/Summary.php:84 +#: src/Module/Admin/Summary.php:82 msgid "The system.url entry is missing. This is a low level setting and can lead to unexpected behavior. Please add a valid entry as soon as possible in the config file or per console command!" msgstr "" -#: src/Module/Admin/Summary.php:89 +#: src/Module/Admin/Summary.php:87 msgid "The worker was never executed. Please check your database structure!" msgstr "" -#: src/Module/Admin/Summary.php:91 +#: src/Module/Admin/Summary.php:89 #, php-format msgid "The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings." msgstr "" -#: src/Module/Admin/Summary.php:96 +#: src/Module/Admin/Summary.php:94 #, php-format msgid "Friendica's configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from .htconfig.php. See the Config help page for help with the transition." msgstr "" -#: src/Module/Admin/Summary.php:100 +#: src/Module/Admin/Summary.php:98 #, php-format msgid "Friendica's configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from config/local.ini.php. See the Config help page for help with the transition." msgstr "" -#: src/Module/Admin/Summary.php:106 +#: src/Module/Admin/Summary.php:104 #, php-format msgid "%s is not reachable on your system. This is a severe configuration issue that prevents server to server communication. See the installation page for help." msgstr "" -#: src/Module/Admin/Summary.php:130 +#: src/Module/Admin/Summary.php:128 #, php-format msgid "Friendica's system.basepath was updated from '%s' to '%s'. Please remove the system.basepath from your db to avoid differences." msgstr "" -#: src/Module/Admin/Summary.php:138 +#: src/Module/Admin/Summary.php:136 #, php-format msgid "Friendica's current system.basepath '%s' is wrong and the config file '%s' isn't used." msgstr "" -#: src/Module/Admin/Summary.php:146 +#: src/Module/Admin/Summary.php:144 #, php-format msgid "Friendica's current system.basepath '%s' is not equal to the config file '%s'. Please fix your configuration." msgstr "" -#: src/Module/Admin/Summary.php:157 +#: src/Module/Admin/Summary.php:155 msgid "Message queues" msgstr "" -#: src/Module/Admin/Summary.php:160 +#: src/Module/Admin/Summary.php:158 msgid "Server Settings" msgstr "" -#: src/Module/Admin/Summary.php:178 +#: src/Module/Admin/Summary.php:176 msgid "Version" msgstr "" -#: src/Module/Admin/Summary.php:182 +#: src/Module/Admin/Summary.php:180 msgid "Active addons" msgstr "" @@ -8424,7 +8424,7 @@ msgstr "" msgid "Keep this window open until done." msgstr "" -#: src/Module/OpenSearch.php:53 +#: src/Module/OpenSearch.php:54 #, php-format msgid "Search in Friendica %s" msgstr "" @@ -8940,11 +8940,11 @@ msgstr "" msgid "OpenID protocol error. No ID returned" msgstr "" -#: src/Module/Security/OpenID.php:76 +#: src/Module/Security/OpenID.php:78 msgid "Account not found. Please login to your existing account to add the OpenID to it." msgstr "" -#: src/Module/Security/OpenID.php:78 +#: src/Module/Security/OpenID.php:80 msgid "Account not found. Please register a new account or login to your existing account to add the OpenID to it." msgstr "" @@ -10740,11 +10740,11 @@ msgstr "" msgid "Possible reasons include:" msgstr "" -#: src/Module/Special/HTTPException.php:64 +#: src/Module/Special/HTTPException.php:65 msgid "Stack trace:" msgstr "" -#: src/Module/Special/HTTPException.php:69 +#: src/Module/Special/HTTPException.php:70 #, php-format msgid "Exception thrown in %s:%d" msgstr "" @@ -11743,20 +11743,20 @@ msgstr "" msgid "Login failed." msgstr "" -#: src/Security/Authentication.php:260 +#: src/Security/Authentication.php:261 msgid "Login failed. Please check your credentials." msgstr "" -#: src/Security/Authentication.php:373 +#: src/Security/Authentication.php:374 #, php-format msgid "Welcome %s" msgstr "" -#: src/Security/Authentication.php:374 +#: src/Security/Authentication.php:375 msgid "Please upload a profile photo." msgstr "" -#: src/Security/OpenWebAuth.php:149 +#: src/Security/OpenWebAuth.php:150 #, php-format msgid "OpenWebAuth: %1$s welcomes %2$s" msgstr ""