mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-15 15:39:31 +00:00
Applied rector rules up to symfony 6.2
This commit is contained in:
parent
88ea920dfb
commit
a43af180a7
145 changed files with 563 additions and 889 deletions
|
|
@ -35,9 +35,10 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
|||
use function count;
|
||||
use function strlen;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand('partdb:currencies:update-exchange-rates|partdb:update-exchange-rates|app:update-exchange-rates', 'Updates the currency exchange rates.')]
|
||||
class UpdateExchangeRatesCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'partdb:currencies:update-exchange-rates|partdb:update-exchange-rates|app:update-exchange-rates';
|
||||
protected static $defaultDescription = 'Updates the currency exchange rates.';
|
||||
|
||||
protected string $base_current;
|
||||
protected EntityManagerInterface $em;
|
||||
|
|
@ -56,9 +57,7 @@ class UpdateExchangeRatesCommand extends Command
|
|||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->setDescription('Updates the currency exchange rates.')
|
||||
->addArgument('iso_code', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The ISO Codes of the currencies that should be updated.');
|
||||
$this->addArgument('iso_code', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The ISO Codes of the currencies that should be updated.');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
|
|
@ -69,7 +68,7 @@ class UpdateExchangeRatesCommand extends Command
|
|||
if (3 !== strlen($this->base_current)) {
|
||||
$io->error('Chosen Base current is not valid. Check your settings!');
|
||||
|
||||
return 1;
|
||||
return \Symfony\Component\Console\Command\Command::FAILURE;
|
||||
}
|
||||
|
||||
$io->note('Update currency exchange rates with base currency: '.$this->base_current);
|
||||
|
|
@ -106,6 +105,6 @@ class UpdateExchangeRatesCommand extends Command
|
|||
|
||||
$io->success(sprintf('%d (of %d) currency exchange rates were updated.', $success_counter, count($candidates)));
|
||||
|
||||
return 0;
|
||||
return \Symfony\Component\Console\Command\Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue