From e61aed4423a81b16ca6be6e91d56f2c9e5ca7d1e Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Wed, 12 Jan 2022 14:36:47 +0100 Subject: [PATCH] minor update --- src/bundle/Command/PageFieldTypeCleanupCommand.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/bundle/Command/PageFieldTypeCleanupCommand.php b/src/bundle/Command/PageFieldTypeCleanupCommand.php index d6a855f..18a0a20 100644 --- a/src/bundle/Command/PageFieldTypeCleanupCommand.php +++ b/src/bundle/Command/PageFieldTypeCleanupCommand.php @@ -96,33 +96,29 @@ protected function execute(InputInterface $input, OutputInterface $output): int $limit = (int) $helper->ask($input, $output, $question); - $count = $this->countOrphanedPageRelations(); - - if ($count) { - $this->deleteOrphanedPageRelations($limit); - } + $this->countOrphanedPageRelations(); + $this->deleteOrphanedPageRelations($limit); $this->io->success('Done'); return 0; } - private function countOrphanedPageRelations(): int + private function countOrphanedPageRelations(): void { $count = $this->gateway->countOrphanedPageRelations(); $count <= 0 ? $this->io->success('Found: 0') : $this->io->caution(sprintf('Found: %d orphaned pages', $count)); - - return $count; } private function deleteOrphanedPageRelations(int $limit): void { if (!$this->io->confirm( sprintf('Are you sure that you want to proceed? The maximum number of pages that will be cleaned - in this iteration is equal to %d.', $limit), + in this iteration is equal to %d. If the number is equal to 0 you can still continue to run the remaining + cleaning methods.', $limit), false) ) { return;