From 7dd5f7c900b1a8015314096972722d06dddd085f Mon Sep 17 00:00:00 2001 From: Vladimir Malik Date: Fri, 11 Apr 2025 16:05:11 +0200 Subject: [PATCH 1/2] Drop legacy check for Symfony 4 and use constants in return. Fix doctypes. --- src/Command/Configuration/MigrateLegacyConfig.php | 10 +++------- src/Command/Configuration/RebuildWorkspacesCommand.php | 9 ++------- src/Command/GraphQL/RebuildDefinitionsCommand.php | 9 ++------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/Command/Configuration/MigrateLegacyConfig.php b/src/Command/Configuration/MigrateLegacyConfig.php index f547b5b3a..12d548131 100644 --- a/src/Command/Configuration/MigrateLegacyConfig.php +++ b/src/Command/Configuration/MigrateLegacyConfig.php @@ -17,7 +17,6 @@ use Pimcore\Console\AbstractCommand; use Pimcore\Model\Tool\SettingsStore; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -63,17 +62,14 @@ private function migrateConfiguration(string $fileName, string $scope): void } /** - * @return int|null + * @return int * * @throws \Exception */ public function execute(InputInterface $input, OutputInterface $output) { $this->migrateConfiguration('datahub-configurations.php', 'pimcore_data_hub'); - if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) { - return Command::SUCCESS; - } else { - return 0; - } + + return self::SUCCESS; } } diff --git a/src/Command/Configuration/RebuildWorkspacesCommand.php b/src/Command/Configuration/RebuildWorkspacesCommand.php index ac9e9487a..610d45c24 100644 --- a/src/Command/Configuration/RebuildWorkspacesCommand.php +++ b/src/Command/Configuration/RebuildWorkspacesCommand.php @@ -18,7 +18,6 @@ use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Bundle\DataHubBundle\WorkspaceHelper; use Pimcore\Console\AbstractCommand; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -41,7 +40,7 @@ protected function configure() /** * * - * @return int|null + * @return int * * @throws \Exception */ @@ -76,10 +75,6 @@ public function execute(InputInterface $input, OutputInterface $output) } } - if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) { - return Command::SUCCESS; - } else { - return 0; - } + return self::SUCCESS; } } diff --git a/src/Command/GraphQL/RebuildDefinitionsCommand.php b/src/Command/GraphQL/RebuildDefinitionsCommand.php index ab87af564..52af2262a 100644 --- a/src/Command/GraphQL/RebuildDefinitionsCommand.php +++ b/src/Command/GraphQL/RebuildDefinitionsCommand.php @@ -44,7 +44,7 @@ protected function configure() * * @throws \Exception * - *@deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead. + * @deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead. * */ public function execute(InputInterface $input, OutputInterface $output) @@ -76,11 +76,6 @@ public function execute(InputInterface $input, OutputInterface $output) $this->output->writeln('done'); - if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) { - return Command::SUCCESS; - } else { - //TODO remove this as soon as support for Symfony 4 gets dropped - return 0; - } + return self::SUCCESS; } } From 7c6776adc9759dd60a4cc1e4b24fc910b07bef41 Mon Sep 17 00:00:00 2001 From: Vladimir Malik Date: Fri, 11 Apr 2025 16:17:49 +0200 Subject: [PATCH 2/2] Removed non-used namespace. --- src/Command/GraphQL/RebuildDefinitionsCommand.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Command/GraphQL/RebuildDefinitionsCommand.php b/src/Command/GraphQL/RebuildDefinitionsCommand.php index 52af2262a..5ea7bb106 100644 --- a/src/Command/GraphQL/RebuildDefinitionsCommand.php +++ b/src/Command/GraphQL/RebuildDefinitionsCommand.php @@ -17,7 +17,6 @@ use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Console\AbstractCommand; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface;