joblist->has(ResetTokenBackgroundJob::class, null); $hasNewResetToken = $this->joblist->has(ResetToken::class, null); if ($hasOldResetToken) { /** * @psalm-suppress UndefinedClass, InvalidArgument */ $this->joblist->remove(ResetTokenBackgroundJob::class); if (!$hasNewResetToken) { $this->joblist->add(ResetToken::class); } } /** * Remove the "has updates" background job, the new one is automatically started from the info.xml * @psalm-suppress UndefinedClass, InvalidArgument */ if ($this->joblist->has(BackgroundJob::class, null)) { /** * @psalm-suppress UndefinedClass, InvalidArgument */ $this->joblist->remove(BackgroundJob::class); } } }