joblist->has(\OCA\UpdateNotification\ResetTokenBackgroundJob::class, null); $hasNewResetToken = $this->joblist->has(ResetToken::class, null); if ($hasOldResetToken) { /** * @psalm-suppress UndefinedClass, InvalidArgument */ $this->joblist->remove(\OCA\UpdateNotification\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(\OCA\UpdateNotification\Notification\BackgroundJob::class, null)) { /** * @psalm-suppress UndefinedClass, InvalidArgument */ $this->joblist->remove(\OCA\UpdateNotification\Notification\BackgroundJob::class); } } }