Fix errors in Model namespace

This commit is contained in:
Art4 2024-12-04 21:41:41 +00:00
parent 2c801abb06
commit 07e9f0f54a
14 changed files with 11 additions and 64 deletions

View file

@ -18,7 +18,7 @@ use Friendica\Object\Log\ParsedLogLine;
*/ */
class ParsedLogIterator implements \Iterator class ParsedLogIterator implements \Iterator
{ {
/** @var \Iterator */ /** @var ReversedFileReader */
private $reader; private $reader;
/** @var ParsedLogLine current iterator value*/ /** @var ParsedLogLine current iterator value*/
@ -33,10 +33,6 @@ class ParsedLogIterator implements \Iterator
/** @var string search term */ /** @var string search term */
private $search = ''; private $search = '';
/**
* @param ReversedFileReader $reader
*/
public function __construct(ReversedFileReader $reader) public function __construct(ReversedFileReader $reader)
{ {
$this->reader = $reader; $this->reader = $reader;

View file

@ -489,9 +489,6 @@ class Photo
* Delete info from table and data from storage * Delete info from table and data from storage
* *
* @param array $conditions Field condition(s) * @param array $conditions Field condition(s)
* @param array $options Options array, Optional
*
* @return boolean
* *
* @throws \Exception * @throws \Exception
* @see \Friendica\Database\DBA::delete * @see \Friendica\Database\DBA::delete

View file

@ -19,8 +19,6 @@ class Post
/** /**
* Insert a new post entry * Insert a new post entry
* *
* @param integer $uri_id
* @param array $fields
* @return bool Success of the insert process * @return bool Success of the insert process
* @throws \Exception * @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 * 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 * @return bool|array
* @throws \Exception * @throws \Exception
* @see DBA::select * @see DBA::select
@ -212,10 +206,6 @@ class Post
* When the requested record is a reshare activity, the system fetches the reshared original post. * When the requested record is a reshare activity, the system fetches the reshared original post.
* Otherwise the function reacts similar to selectFirst * 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 * @return bool|array
* @throws \Exception * @throws \Exception
* @see DBA::select * @see DBA::select
@ -300,7 +290,7 @@ class Post
/** /**
* Select rows from the post-user-view view and returns them as an array * 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 $condition Array of fields for condition
* @param array $params Array of several parameters * @param array $params Array of several parameters
* *
@ -767,9 +757,6 @@ class Post
* Delete a row from the post table * Delete a row from the post table
* *
* @param array $conditions Field condition(s) * @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? * @return boolean was the delete successful?
* @throws \Exception * @throws \Exception

View file

@ -16,9 +16,6 @@ class Activity
/** /**
* Insert a new post-activity entry * Insert a new post-activity entry
* *
* @param integer $uri_id
* @param array $fields
*
* @return bool success * @return bool success
*/ */
public static function insert(int $uri_id, string $source): bool public static function insert(int $uri_id, string $source): bool

View file

@ -140,8 +140,6 @@ class Category
* Inserts new terms for the provided item ID based on the legacy item.file field BBCode content. * 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. * Deletes all previous file terms for the same item ID.
* *
* @param integer $item_id item id
* @param $files
* @return void * @return void
* @throws \Exception * @throws \Exception
*/ */

View file

@ -62,9 +62,6 @@ class Collection
/** /**
* Fetch collections for a given contact * Fetch collections for a given contact
* *
* @param integer $cid
* @param [type] $type
* @param array $fields
* @return array * @return array
*/ */
public static function selectToArrayForContact(int $cid, int $type = self::FEATURED, array $fields = []) public static function selectToArrayForContact(int $cid, int $type = self::FEATURED, array $fields = [])

View file

@ -11,7 +11,6 @@ use \BadMethodCallException;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Model\Post; use Friendica\Model\Post;
class Content class Content
@ -19,8 +18,6 @@ class Content
/** /**
* Insert a new post-content entry * Insert a new post-content entry
* *
* @param integer $uri_id
* @param array $fields
* @return bool success * @return bool success
* @throws \Exception * @throws \Exception
*/ */

View file

@ -17,11 +17,6 @@ class Delivery
{ {
/** /**
* Add a post to an inbox * 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) public static function add(int $uri_id, int $uid, string $inbox, string $created, string $command, array $receivers)
{ {

View file

@ -17,7 +17,6 @@ class Origin
/** /**
* Insert a new post origin entry * Insert a new post origin entry
* *
* @param array $fields
* @return boolean was the insert successful? * @return boolean was the insert successful?
* @throws \Exception * @throws \Exception
*/ */

View file

@ -10,7 +10,6 @@ namespace Friendica\Model\Post;
use \BadMethodCallException; use \BadMethodCallException;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI; use Friendica\DI;
class Thread class Thread
@ -18,8 +17,6 @@ class Thread
/** /**
* Insert a new post-thread entry * Insert a new post-thread entry
* *
* @param integer $uri_id
* @param array $fields
* @return bool success * @return bool success
* @throws \Exception * @throws \Exception
*/ */

View file

@ -7,10 +7,10 @@
namespace Friendica\Model\Post; namespace Friendica\Model\Post;
use \BadMethodCallException; use BadMethodCallException;
use Exception;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI; use Friendica\DI;
class ThreadUser class ThreadUser
@ -18,9 +18,6 @@ class ThreadUser
/** /**
* Insert a new URI user entry * Insert a new URI user entry
* *
* @param integer $uri_id
* @param integer $uid
* @param array $fields
* @return bool success * @return bool success
* @throws \Exception * @throws \Exception
*/ */
@ -72,9 +69,6 @@ class ThreadUser
* Delete a row from the post-thread-user table * Delete a row from the post-thread-user table
* *
* @param array $conditions Field condition(s) * @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? * @return boolean was the delete successful?
* @throws \Exception * @throws \Exception

View file

@ -7,9 +7,9 @@
namespace Friendica\Model\Post; namespace Friendica\Model\Post;
use Friendica\Database\DBA; use BadMethodCallException;
use \BadMethodCallException;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Protocol\Activity; use Friendica\Protocol\Activity;
@ -19,9 +19,6 @@ class User
/** /**
* Insert a new post user entry * Insert a new post user entry
* *
* @param integer $uri_id
* @param integer $uid
* @param array $fields
* @return int ID of inserted post-user * @return int ID of inserted post-user
* @throws \Exception * @throws \Exception
*/ */

View file

@ -33,7 +33,7 @@ class Profile
/** /**
* Returns default profile for a given user id * 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 * @return array|bool Profile data or false on error
* @throws \Exception * @throws \Exception
@ -62,7 +62,7 @@ class Profile
* Returns profile data for the contact owner * Returns profile data for the contact owner
* *
* @param int $uid The User ID * @param int $uid The User ID
* @param array|bool $fields The fields to retrieve or false on error * @param array $fields The fields to retrieve or false on error
* *
* @return array Array of profile data * @return array Array of profile data
* @throws \Exception * @throws \Exception

View file

@ -12,7 +12,7 @@ use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Factory\Api\Mastodon\Notification as NotificationFactory; 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 Friendica\Object\Api\Mastodon\Notification;
use Minishlink\WebPush\VAPID; use Minishlink\WebPush\VAPID;
@ -21,9 +21,6 @@ class Subscription
/** /**
* Select a subscription record exists * Select a subscription record exists
* *
* @param int $applicationid
* @param int $uid
* @param array $fields
* @return array|bool Array on success, false on failure * @return array|bool Array on success, false on failure
*/ */
public static function select(int $applicationid, int $uid, array $fields = []) public static function select(int $applicationid, int $uid, array $fields = [])
@ -120,10 +117,9 @@ class Subscription
/** /**
* Prepare push notification * Prepare push notification
* *
* @param Notification $Notification
* @return void * @return void
*/ */
public static function pushByNotification(Entity\Notification $notification) public static function pushByNotification(EntityNotification $notification)
{ {
$type = NotificationFactory::getType($notification); $type = NotificationFactory::getType($notification);