From 33ce1f2e66edc77d38693cd91304f2b6c293ca47 Mon Sep 17 00:00:00 2001 From: Karsten Nowak Date: Mon, 29 Jul 2024 17:21:27 +0200 Subject: [PATCH] [BUGFIX] Fix errors from php cs fixer Related: #1120 --- Classes/Command/CreateTestDataCommand.php | 17 +++++++++-------- Configuration/Services.php | 7 ++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Classes/Command/CreateTestDataCommand.php b/Classes/Command/CreateTestDataCommand.php index 13d0885..39e0052 100644 --- a/Classes/Command/CreateTestDataCommand.php +++ b/Classes/Command/CreateTestDataCommand.php @@ -24,13 +24,13 @@ final class CreateTestDataCommand extends Command [ 'title' => 'Darjeeling', 'description' => 'I love that tea!', - 'sys_language_uid' => 0 + 'sys_language_uid' => 0, ], [ 'title' => 'Earl Grey', 'description' => 'A nice tea!', - 'sys_language_uid' => 0 - ] + 'sys_language_uid' => 0, + ], ]; protected function configure(): void { @@ -51,23 +51,24 @@ final class CreateTestDataCommand extends Command protected function execute(InputInterface $input, OutputInterface $output): int { - /** @var integer $pageId */ + /** @var int $pageId */ $pageId = $input->getArgument('pageId') ?? 0; - /** @var boolean $deleteDataBefore */ + /** @var bool $deleteDataBefore */ $deleteDataBefore = $input->getOption('delete-data-before') ?? false; $table = 'tx_tea_domain_model_tea'; $connectionForTable = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table); - if($deleteDataBefore) { + if ($deleteDataBefore) { $query = $connectionForTable; $query->delete($table, ['pid' => $pageId], [Connection::PARAM_INT]); - $output->writeln(sprintf('Existing data in page %s deleted.',$pageId)); + $output->writeln(sprintf('Existing data in page %s deleted.', $pageId)); } $query = $connectionForTable; foreach ($this->teaData as $item) { $item = ['pid' => $pageId, ...$item]; - $query->insert($table, + $query->insert( + $table, $item ); } diff --git a/Configuration/Services.php b/Configuration/Services.php index 802bfa3..262c210 100644 --- a/Configuration/Services.php +++ b/Configuration/Services.php @@ -16,10 +16,11 @@ return static function (ContainerConfigurator $containerConfigurator) { ->exclude('../Classes/Domain/Model/*'); $services->set(CreateTestDataCommand::class) - ->tag('console.command', [ + ->tag( + 'console.command', + [ 'command' => 'tea:createtestdata', - 'description'=>'Create test data in existing sysfolder' + 'description' => 'Create test data in existing sysfolder', ] ); - };