mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02: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
|
@ -47,6 +47,7 @@ use function count;
|
|||
/**
|
||||
* This command converts the BBCode used by old Part-DB versions (<1.0), to the current used Markdown format.
|
||||
*/
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand('partdb:migrations:convert-bbcode|app:convert-bbcode', 'Converts BBCode used in old Part-DB versions to newly used Markdown')]
|
||||
class ConvertBBCodeCommand extends Command
|
||||
{
|
||||
/**
|
||||
|
@ -58,7 +59,7 @@ class ConvertBBCodeCommand extends Command
|
|||
*/
|
||||
protected const BBCODE_REGEX = '/\\[.+\\].*\\[\\/.+\\]/';
|
||||
|
||||
protected static $defaultName = 'partdb:migrations:convert-bbcode|app:convert-bbcode';
|
||||
protected static $defaultDescription = 'Converts BBCode used in old Part-DB versions to newly used Markdown';
|
||||
|
||||
protected EntityManagerInterface $em;
|
||||
protected PropertyAccessorInterface $propertyAccessor;
|
||||
|
@ -76,9 +77,7 @@ class ConvertBBCodeCommand extends Command
|
|||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->setDescription('Converts BBCode used in old Part-DB versions to newly used Markdown')
|
||||
->setHelp('Older versions of Part-DB (<1.0) used BBCode for rich text formatting.
|
||||
$this->setHelp('Older versions of Part-DB (<1.0) used BBCode for rich text formatting.
|
||||
Part-DB now uses Markdown which offers more features but is incompatible with BBCode.
|
||||
When you upgrade from an pre 1.0 version you have to run this command to convert your comment fields');
|
||||
|
||||
|
@ -168,6 +167,6 @@ class ConvertBBCodeCommand extends Command
|
|||
$io->success('Changes saved to DB successfully!');
|
||||
}
|
||||
|
||||
return 0;
|
||||
return \Symfony\Component\Console\Command\Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,11 @@ use Symfony\Component\Console\Input\InputOption;
|
|||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand('partdb:migrations:import-partkeepr', 'Import a PartKeepr database XML dump into Part-DB')]
|
||||
class ImportPartKeeprCommand extends Command
|
||||
{
|
||||
|
||||
protected static $defaultName = 'partdb:migrations:import-partkeepr';
|
||||
protected static $defaultDescription = 'Import a PartKeepr database XML dump into Part-DB';
|
||||
|
||||
protected EntityManagerInterface $em;
|
||||
protected MySQLDumpXMLConverter $xml_converter;
|
||||
|
@ -60,7 +61,6 @@ class ImportPartKeeprCommand extends Command
|
|||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setDescription('Import a PartKeepr database XML dump into Part-DB');
|
||||
$this->setHelp('This command allows you to import a PartKeepr database exported by mysqldump as XML file into Part-DB');
|
||||
|
||||
$this->addArgument('file', InputArgument::REQUIRED, 'The file to which should be imported.');
|
||||
|
@ -100,7 +100,7 @@ class ImportPartKeeprCommand extends Command
|
|||
if (!$this->importHelper->checkVersion($data)) {
|
||||
$db_version = $this->importHelper->getDatabaseSchemaVersion($data);
|
||||
$io->error('The version of the imported database is not supported! (Version: '.$db_version.')');
|
||||
return 1;
|
||||
return \Symfony\Component\Console\Command\Command::FAILURE;
|
||||
}
|
||||
|
||||
//Import the mandatory data
|
||||
|
@ -118,7 +118,7 @@ class ImportPartKeeprCommand extends Command
|
|||
$io->success('Imported '.$count.' users.');
|
||||
}
|
||||
|
||||
return 0;
|
||||
return \Symfony\Component\Console\Command\Command::SUCCESS;
|
||||
}
|
||||
|
||||
private function doImport(SymfonyStyle $io, array $data): void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue