option('page'); $pageId = null; if ($pageOption !== null && $pageOption !== '') { if (! is_numeric($pageOption)) { $this->error(__('The --page option must be a numeric ID.')); return self::FAILURE; } $pageId = (int) $pageOption; } $eligible = $dispatcher->eligibleSubscribersQuery() ->when($pageId !== null, fn ($q) => $q->where('preregistration_page_id', $pageId)) ->count(); if ($this->option('dry-run')) { $this->info(__(':count subscriber(s) would be processed.', ['count' => $eligible])); return self::SUCCESS; } $processed = $dispatcher->dispatch($pageId); $this->info(__('Queued sync for :count subscriber(s). Duplicate jobs for the same subscriber are skipped while one is already pending.', ['count' => $processed])); return self::SUCCESS; } }