@@ -17,49 +17,49 @@ |
||
| 17 | 17 | use Symfony\Component\Console\Question\ConfirmationQuestion; |
| 18 | 18 | |
| 19 | 19 | class Delete extends Base { |
| 20 | - public function __construct( |
|
| 21 | - protected IJobList $jobList, |
|
| 22 | - ) { |
|
| 23 | - parent::__construct(); |
|
| 24 | - } |
|
| 20 | + public function __construct( |
|
| 21 | + protected IJobList $jobList, |
|
| 22 | + ) { |
|
| 23 | + parent::__construct(); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - protected function configure(): void { |
|
| 27 | - $this |
|
| 28 | - ->setName('background-job:delete') |
|
| 29 | - ->setDescription('Remove a background job from database') |
|
| 30 | - ->addArgument( |
|
| 31 | - 'job-id', |
|
| 32 | - InputArgument::REQUIRED, |
|
| 33 | - 'The ID of the job in the database' |
|
| 34 | - ); |
|
| 35 | - } |
|
| 26 | + protected function configure(): void { |
|
| 27 | + $this |
|
| 28 | + ->setName('background-job:delete') |
|
| 29 | + ->setDescription('Remove a background job from database') |
|
| 30 | + ->addArgument( |
|
| 31 | + 'job-id', |
|
| 32 | + InputArgument::REQUIRED, |
|
| 33 | + 'The ID of the job in the database' |
|
| 34 | + ); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 38 | - $jobId = (string)$input->getArgument('job-id'); |
|
| 37 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 38 | + $jobId = (string)$input->getArgument('job-id'); |
|
| 39 | 39 | |
| 40 | - $job = $this->jobList->getById($jobId); |
|
| 41 | - if ($job === null) { |
|
| 42 | - $output->writeln('<error>Job with ID ' . $jobId . ' could not be found in the database</error>'); |
|
| 43 | - return 1; |
|
| 44 | - } |
|
| 40 | + $job = $this->jobList->getById($jobId); |
|
| 41 | + if ($job === null) { |
|
| 42 | + $output->writeln('<error>Job with ID ' . $jobId . ' could not be found in the database</error>'); |
|
| 43 | + return 1; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $output->writeln('Job class: ' . get_class($job)); |
|
| 47 | - $output->writeln('Arguments: ' . json_encode($job->getArgument())); |
|
| 48 | - $output->writeln(''); |
|
| 46 | + $output->writeln('Job class: ' . get_class($job)); |
|
| 47 | + $output->writeln('Arguments: ' . json_encode($job->getArgument())); |
|
| 48 | + $output->writeln(''); |
|
| 49 | 49 | |
| 50 | - $question = new ConfirmationQuestion( |
|
| 51 | - '<comment>Do you really want to delete this background job ? It could create some misbehaviours in Nextcloud.</comment> (y/N) ', false, |
|
| 52 | - '/^(y|Y)/i' |
|
| 53 | - ); |
|
| 50 | + $question = new ConfirmationQuestion( |
|
| 51 | + '<comment>Do you really want to delete this background job ? It could create some misbehaviours in Nextcloud.</comment> (y/N) ', false, |
|
| 52 | + '/^(y|Y)/i' |
|
| 53 | + ); |
|
| 54 | 54 | |
| 55 | - /** @var QuestionHelper $helper */ |
|
| 56 | - $helper = $this->getHelper('question'); |
|
| 57 | - if (!$helper->ask($input, $output, $question)) { |
|
| 58 | - $output->writeln('aborted.'); |
|
| 59 | - return 0; |
|
| 60 | - } |
|
| 55 | + /** @var QuestionHelper $helper */ |
|
| 56 | + $helper = $this->getHelper('question'); |
|
| 57 | + if (!$helper->ask($input, $output, $question)) { |
|
| 58 | + $output->writeln('aborted.'); |
|
| 59 | + return 0; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - $this->jobList->remove($job, $job->getArgument()); |
|
| 63 | - return 0; |
|
| 64 | - } |
|
| 62 | + $this->jobList->remove($job, $job->getArgument()); |
|
| 63 | + return 0; |
|
| 64 | + } |
|
| 65 | 65 | } |