<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Worker;
+use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Model\Post;
* Removes orphaned data from deleted users
*/
class RemoveUser {
- public static function execute($uid)
+ /**
+ * Removes user by id
+ *
+ * @param int $uid User id
+ * @return void
+ */
+ public static function execute(int $uid)
{
// Only delete if the user is archived
$condition = ['account_removed' => true, 'uid' => $uid];
do {
$items = Post::select(['id'], $condition, ['limit' => 100]);
while ($item = Post::fetch($items)) {
- Item::markForDeletionById($item['id'], PRIORITY_NEGLIGIBLE);
+ Item::markForDeletionById($item['id'], Worker::PRIORITY_NEGLIGIBLE);
}
DBA::close($items);
} while (Post::exists($condition));