From ab70bbd3ffbc3788035588c86984f9508db8edbe Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 20 Jul 2023 00:05:59 +0200 Subject: fix(db)!: Remove private legacy event because we can not keep it Signed-off-by: Joas Schilling --- .../lib/Controller/CheckSetupController.php | 27 +++++----------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'apps/settings/lib/Controller/CheckSetupController.php') diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 5d7989f0256..4a1913cedfe 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -92,8 +92,6 @@ use OCP\Lock\ILockingProvider; use OCP\Notification\IManager; use OCP\Security\ISecureRandom; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\GenericEvent; #[IgnoreOpenAPI] class CheckSetupController extends Controller { @@ -110,8 +108,6 @@ class CheckSetupController extends Controller { /** @var LoggerInterface */ private $logger; /** @var IEventDispatcher */ - private $eventDispatcher; - /** @var EventDispatcherInterface */ private $dispatcher; /** @var Connection */ private $db; @@ -144,8 +140,7 @@ class CheckSetupController extends Controller { IL10N $l10n, Checker $checker, LoggerInterface $logger, - IEventDispatcher $eventDispatcher, - EventDispatcherInterface $dispatcher, + IEventDispatcher $dispatcher, Connection $db, ILockingProvider $lockingProvider, IDateTimeFormatter $dateTimeFormatter, @@ -165,7 +160,6 @@ class CheckSetupController extends Controller { $this->l10n = $l10n; $this->checker = $checker; $this->logger = $logger; - $this->eventDispatcher = $eventDispatcher; $this->dispatcher = $dispatcher; $this->db = $db; $this->lockingProvider = $lockingProvider; @@ -553,11 +547,8 @@ Raw output $indexInfo = new MissingIndexInformation(); // Dispatch event so apps can also hint for pending index updates if needed - $event = new GenericEvent($indexInfo); - $this->dispatcher->dispatch(IDBConnection::CHECK_MISSING_INDEXES_EVENT, $event); - $event = new AddMissingIndicesEvent(); - $this->eventDispatcher->dispatchTyped($event); + $this->dispatcher->dispatchTyped($event); $missingIndices = $event->getMissingIndices(); if ($missingIndices !== []) { @@ -577,12 +568,9 @@ Raw output protected function hasMissingPrimaryKeys(): array { $info = new MissingPrimaryKeyInformation(); - // Dispatch event so apps can also hint for pending index updates if needed - $event = new GenericEvent($info); - $this->dispatcher->dispatch(IDBConnection::CHECK_MISSING_PRIMARY_KEYS_EVENT, $event); - + // Dispatch event so apps can also hint for pending key updates if needed $event = new AddMissingPrimaryKeyEvent(); - $this->eventDispatcher->dispatchTyped($event); + $this->dispatcher->dispatchTyped($event); $missingKeys = $event->getMissingPrimaryKeys(); if (!empty($missingKeys)) { @@ -602,12 +590,9 @@ Raw output protected function hasMissingColumns(): array { $columnInfo = new MissingColumnInformation(); - // Dispatch event so apps can also hint for pending index updates if needed - $event = new GenericEvent($columnInfo); - $this->dispatcher->dispatch(IDBConnection::CHECK_MISSING_COLUMNS_EVENT, $event); - + // Dispatch event so apps can also hint for pending column updates if needed $event = new AddMissingColumnsEvent(); - $this->eventDispatcher->dispatchTyped($event); + $this->dispatcher->dispatchTyped($event); $missingColumns = $event->getMissingColumns(); if (!empty($missingColumns)) { -- cgit v1.2.3