]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/RemoveUser.php
Merge pull request #12951 from jsoref/spelling
[friendica.git] / src / Worker / RemoveUser.php
index 0db881a0a99e8e19c961c868ebfeb139bd0d8db5..ac67d69f965496d5bb126c94fb1227060726ab40 100644 (file)
@@ -1,6 +1,6 @@
 <?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
  *
@@ -21,6 +21,7 @@
 
 namespace Friendica\Worker;
 
+use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
 use Friendica\Model\Post;
@@ -29,7 +30,13 @@ 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];
@@ -42,7 +49,7 @@ class RemoveUser {
                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));