}
}
- private function repair(IOutput $output) {
- $total = $this->getTotal();
+ private function repair(IOutput $output, int $total) {
$output->startProgress($total);
$shareCursor = $this->getShares();
}
public function run(IOutput $output) {
- if ($this->shouldRun()) {
- $output->info('Removing potentially over exposing link shares');
- $this->repair($output);
- $output->info('Removed potentially over exposing link shares');
- } else {
+ if ($this->shouldRun() === false || ($total = $this->getTotal()) === 0) {
$output->info('No need to remove link shares.');
+ return;
}
+
+ $output->info('Removing potentially over exposing link shares');
+ $this->repair($output, $total);
+ $output->info('Removed potentially over exposing link shares');
}
}