From 07e9f0f54ab07c33af3e5da36eac8378aec0fa6b Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 4 Dec 2024 21:41:41 +0000 Subject: [PATCH] Fix errors in Model namespace --- src/Model/Log/ParsedLogIterator.php | 6 +----- src/Model/Photo.php | 3 --- src/Model/Post.php | 15 +-------------- src/Model/Post/Activity.php | 3 --- src/Model/Post/Category.php | 2 -- src/Model/Post/Collection.php | 3 --- src/Model/Post/Content.php | 3 --- src/Model/Post/Delivery.php | 5 ----- src/Model/Post/Origin.php | 1 - src/Model/Post/Thread.php | 3 --- src/Model/Post/ThreadUser.php | 10 ++-------- src/Model/Post/User.php | 7 ++----- src/Model/Profile.php | 6 +++--- src/Model/Subscription.php | 8 ++------ 14 files changed, 11 insertions(+), 64 deletions(-) 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 126edd379c..1858a1b590 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -489,9 +489,6 @@ 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 diff --git a/src/Model/Post.php b/src/Model/Post.php index 111cd77cc4..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,9 +757,6 @@ 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 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 e0a037ad9d..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 */ 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 b3451fee8e..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 */ diff --git a/src/Model/Post/Thread.php b/src/Model/Post/Thread.php index b7f51f920a..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 */ diff --git a/src/Model/Post/ThreadUser.php b/src/Model/Post/ThreadUser.php index 8a5baf51ff..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,9 +69,6 @@ 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 diff --git a/src/Model/Post/User.php b/src/Model/Post/User.php index ec7f6b2c0f..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 */ 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..18b6a48e62 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 EntityNotification; 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(EntityNotification $notification) { $type = NotificationFactory::getType($notification);