From 155fbba14a1a311b6b41e5d52ff730ef0ec5c84b Mon Sep 17 00:00:00 2001 From: Herbert Roth Date: Fri, 3 Oct 2025 10:34:41 +0000 Subject: [PATCH 1/6] Refactor command configuration to use attributes instead of method calls --- .../Configuration/MigrateLegacyConfig.php | 13 ++++---- .../RebuildWorkspacesCommand.php | 32 +++++++++---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Command/Configuration/MigrateLegacyConfig.php b/src/Command/Configuration/MigrateLegacyConfig.php index ae1c64bf..81a26448 100644 --- a/src/Command/Configuration/MigrateLegacyConfig.php +++ b/src/Command/Configuration/MigrateLegacyConfig.php @@ -14,6 +14,7 @@ use Pimcore\Console\AbstractCommand; use Pimcore\Model\Tool\SettingsStore; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -21,13 +22,15 @@ /** * @internal */ +#[AsCommand( + name: 'datahub:configuration:migrate-legacy-config', + description: 'Migrate legacy configurations (datahub-configurations.php) to YAML or settings store, depending on your configuration.' +)] final class MigrateLegacyConfig extends AbstractCommand { protected function configure(): void { - $this - ->setName('datahub:configuration:migrate-legacy-config') - ->setDescription('Migrate legacy configurations (datahub-configurations.php) to YAML or settings store, depending on your configuration.'); + // Configuration moved to AsCommand attribute } private function loadLegacyConfigs(string $fileName): array @@ -63,11 +66,9 @@ private function migrateConfiguration(string $fileName, string $scope): void } /** - * @return int|null - * * @throws \Exception */ - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $this->migrateConfiguration('datahub-configurations.php', 'pimcore_data_hub'); if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) { diff --git a/src/Command/Configuration/RebuildWorkspacesCommand.php b/src/Command/Configuration/RebuildWorkspacesCommand.php index d8226c8c..f8daabb3 100644 --- a/src/Command/Configuration/RebuildWorkspacesCommand.php +++ b/src/Command/Configuration/RebuildWorkspacesCommand.php @@ -12,40 +12,38 @@ namespace Pimcore\Bundle\DataHubBundle\Command\Configuration; -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 Pimcore\Bundle\DataHubBundle\Configuration; use Symfony\Component\Console\Input\InputOption; +use Pimcore\Bundle\DataHubBundle\WorkspaceHelper; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; /** * @internal */ +#[AsCommand( + name: 'datahub:configuration:rebuild-workspaces', + description: 'Migrate workspaces from configuration files to database.' +)] final class RebuildWorkspacesCommand extends AbstractCommand { protected function configure(): void { - $this - ->setName('datahub:configuration:rebuild-workspaces') - ->setDescription('Migrate workspaces from configuration files to database.') - ->addOption( - 'configs', - null, - InputOption::VALUE_OPTIONAL, - 'Comma separated list of configurations' - ); + $this->addOption( + 'configs', + null, + InputOption::VALUE_OPTIONAL, + 'Comma separated list of configurations' + ); } /** - * - * - * @return int|null - * * @throws \Exception */ - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $list = []; $options = $input->getOption('configs'); From 1a39971d75c3124a641f5b5fe4a154fb0d047d92 Mon Sep 17 00:00:00 2001 From: herbertroth <126679157+herbertroth@users.noreply.github.com> Date: Mon, 13 Oct 2025 13:02:26 +0000 Subject: [PATCH 2/6] Apply php-cs-fixer changes --- src/Command/Configuration/RebuildWorkspacesCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Command/Configuration/RebuildWorkspacesCommand.php b/src/Command/Configuration/RebuildWorkspacesCommand.php index f8daabb3..e009d292 100644 --- a/src/Command/Configuration/RebuildWorkspacesCommand.php +++ b/src/Command/Configuration/RebuildWorkspacesCommand.php @@ -12,13 +12,13 @@ namespace Pimcore\Bundle\DataHubBundle\Command\Configuration; -use Pimcore\Console\AbstractCommand; -use Symfony\Component\Console\Command\Command; use Pimcore\Bundle\DataHubBundle\Configuration; -use Symfony\Component\Console\Input\InputOption; use Pimcore\Bundle\DataHubBundle\WorkspaceHelper; +use Pimcore\Console\AbstractCommand; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** From 536374b05b8518ac117e8b66d04b3328f5f1f6eb Mon Sep 17 00:00:00 2001 From: Herbert Roth Date: Wed, 15 Oct 2025 12:30:01 +0000 Subject: [PATCH 3/6] Refactor dependency injection to use Pimcore\Bundle\CoreBundle components --- src/GraphQL/AssetType/AssetTreeType.php | 4 ++-- src/GraphQL/ClassificationstoreType/Feature.php | 4 ++-- src/GraphQL/DataObjectType/AbstractRelationsType.php | 4 ++-- src/GraphQL/DataObjectType/BlockEntryType.php | 4 ++-- src/GraphQL/DataObjectType/FieldcollectionType.php | 4 ++-- src/GraphQL/DataObjectType/ObjectTreeType.php | 4 ++-- src/GraphQL/DocumentType/DocumentElementType.php | 6 ++---- src/GraphQL/DocumentType/DocumentTreeType.php | 4 ++-- src/GraphQL/DocumentType/DocumentType.php | 4 ++-- src/GraphQL/General/AnyDocumentTargetType.php | 4 ++-- src/GraphQL/General/AnyTargetType.php | 4 ++-- src/GraphQL/PropertyType/ObjectsType.php | 4 ++-- 12 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/GraphQL/AssetType/AssetTreeType.php b/src/GraphQL/AssetType/AssetTreeType.php index 5c948954..f719e80f 100644 --- a/src/GraphQL/AssetType/AssetTreeType.php +++ b/src/GraphQL/AssetType/AssetTreeType.php @@ -20,8 +20,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Asset; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/ClassificationstoreType/Feature.php b/src/GraphQL/ClassificationstoreType/Feature.php index 50013bac..072654a5 100644 --- a/src/GraphQL/ClassificationstoreType/Feature.php +++ b/src/GraphQL/ClassificationstoreType/Feature.php @@ -20,8 +20,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\FeatureDescriptor; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/AbstractRelationsType.php b/src/GraphQL/DataObjectType/AbstractRelationsType.php index a67d8be3..9d6ec8c9 100644 --- a/src/GraphQL/DataObjectType/AbstractRelationsType.php +++ b/src/GraphQL/DataObjectType/AbstractRelationsType.php @@ -24,8 +24,8 @@ use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Fieldcollection\Definition; use Pimcore\Model\Document; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; abstract class AbstractRelationsType extends UnionType implements ContainerAwareInterface { diff --git a/src/GraphQL/DataObjectType/BlockEntryType.php b/src/GraphQL/DataObjectType/BlockEntryType.php index c66898b1..3cbab639 100644 --- a/src/GraphQL/DataObjectType/BlockEntryType.php +++ b/src/GraphQL/DataObjectType/BlockEntryType.php @@ -21,8 +21,8 @@ use Pimcore\Model\DataObject\ClassDefinition; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Fieldcollection\Definition; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/FieldcollectionType.php b/src/GraphQL/DataObjectType/FieldcollectionType.php index 2965122b..956268c5 100644 --- a/src/GraphQL/DataObjectType/FieldcollectionType.php +++ b/src/GraphQL/DataObjectType/FieldcollectionType.php @@ -18,8 +18,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Cache\RuntimeCache; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/ObjectTreeType.php b/src/GraphQL/DataObjectType/ObjectTreeType.php index 98cd8701..cb6ff9d2 100644 --- a/src/GraphQL/DataObjectType/ObjectTreeType.php +++ b/src/GraphQL/DataObjectType/ObjectTreeType.php @@ -24,8 +24,8 @@ use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle; use Pimcore\Cache\RuntimeCache; use Pimcore\Model\DataObject; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DocumentType/DocumentElementType.php b/src/GraphQL/DocumentType/DocumentElementType.php index 6224ca08..f002581b 100644 --- a/src/GraphQL/DocumentType/DocumentElementType.php +++ b/src/GraphQL/DocumentType/DocumentElementType.php @@ -18,8 +18,8 @@ use GraphQL\Type\Definition\UnionType; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal @@ -29,8 +29,6 @@ final class DocumentElementType extends UnionType implements ContainerAwareInter use ContainerAwareTrait; use ServiceTrait; - protected $container; - /** * @param array $config */ diff --git a/src/GraphQL/DocumentType/DocumentTreeType.php b/src/GraphQL/DocumentType/DocumentTreeType.php index aa0f19e4..8d819d0c 100644 --- a/src/GraphQL/DocumentType/DocumentTreeType.php +++ b/src/GraphQL/DocumentType/DocumentTreeType.php @@ -19,8 +19,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; use Pimcore\Model\Element\ElementInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DocumentType/DocumentType.php b/src/GraphQL/DocumentType/DocumentType.php index 3caaeb90..c80bc1ee 100644 --- a/src/GraphQL/DocumentType/DocumentType.php +++ b/src/GraphQL/DocumentType/DocumentType.php @@ -19,8 +19,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/General/AnyDocumentTargetType.php b/src/GraphQL/General/AnyDocumentTargetType.php index cd5b951c..85396996 100644 --- a/src/GraphQL/General/AnyDocumentTargetType.php +++ b/src/GraphQL/General/AnyDocumentTargetType.php @@ -17,8 +17,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/General/AnyTargetType.php b/src/GraphQL/General/AnyTargetType.php index ef5c8273..ebdd4d30 100644 --- a/src/GraphQL/General/AnyTargetType.php +++ b/src/GraphQL/General/AnyTargetType.php @@ -18,8 +18,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/PropertyType/ObjectsType.php b/src/GraphQL/PropertyType/ObjectsType.php index f2d39966..5d283f74 100644 --- a/src/GraphQL/PropertyType/ObjectsType.php +++ b/src/GraphQL/PropertyType/ObjectsType.php @@ -20,8 +20,8 @@ use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal From f188d37ee0084be25d1b2e70a0828ddaa0314be8 Mon Sep 17 00:00:00 2001 From: herbertroth <126679157+herbertroth@users.noreply.github.com> Date: Wed, 15 Oct 2025 12:30:38 +0000 Subject: [PATCH 4/6] Apply php-cs-fixer changes --- src/GraphQL/AssetType/AssetTreeType.php | 4 ++-- src/GraphQL/ClassificationstoreType/Feature.php | 4 ++-- src/GraphQL/DataObjectType/AbstractRelationsType.php | 4 ++-- src/GraphQL/DataObjectType/BlockEntryType.php | 4 ++-- src/GraphQL/DataObjectType/FieldcollectionType.php | 4 ++-- src/GraphQL/DataObjectType/ObjectTreeType.php | 4 ++-- src/GraphQL/DocumentType/DocumentElementType.php | 4 ++-- src/GraphQL/DocumentType/DocumentTreeType.php | 4 ++-- src/GraphQL/DocumentType/DocumentType.php | 4 ++-- src/GraphQL/General/AnyDocumentTargetType.php | 4 ++-- src/GraphQL/General/AnyTargetType.php | 4 ++-- src/GraphQL/PropertyType/ObjectsType.php | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/GraphQL/AssetType/AssetTreeType.php b/src/GraphQL/AssetType/AssetTreeType.php index f719e80f..d7b74a6c 100644 --- a/src/GraphQL/AssetType/AssetTreeType.php +++ b/src/GraphQL/AssetType/AssetTreeType.php @@ -17,11 +17,11 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Asset; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/ClassificationstoreType/Feature.php b/src/GraphQL/ClassificationstoreType/Feature.php index 072654a5..6216c9f9 100644 --- a/src/GraphQL/ClassificationstoreType/Feature.php +++ b/src/GraphQL/ClassificationstoreType/Feature.php @@ -16,12 +16,12 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\Exception\ClientSafeException; use Pimcore\Bundle\DataHubBundle\GraphQL\FeatureDescriptor; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/AbstractRelationsType.php b/src/GraphQL/DataObjectType/AbstractRelationsType.php index 9d6ec8c9..e779c61f 100644 --- a/src/GraphQL/DataObjectType/AbstractRelationsType.php +++ b/src/GraphQL/DataObjectType/AbstractRelationsType.php @@ -16,6 +16,8 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\ClassTypeDefinitions; use Pimcore\Bundle\DataHubBundle\GraphQL\DocumentType\DocumentType; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; @@ -24,8 +26,6 @@ use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Fieldcollection\Definition; use Pimcore\Model\Document; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; abstract class AbstractRelationsType extends UnionType implements ContainerAwareInterface { diff --git a/src/GraphQL/DataObjectType/BlockEntryType.php b/src/GraphQL/DataObjectType/BlockEntryType.php index 3cbab639..4cec5a74 100644 --- a/src/GraphQL/DataObjectType/BlockEntryType.php +++ b/src/GraphQL/DataObjectType/BlockEntryType.php @@ -14,6 +14,8 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\BlockDescriptor; use Pimcore\Bundle\DataHubBundle\GraphQL\Helper; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; @@ -21,8 +23,6 @@ use Pimcore\Model\DataObject\ClassDefinition; use Pimcore\Model\DataObject\ClassDefinition\Data; use Pimcore\Model\DataObject\Fieldcollection\Definition; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/FieldcollectionType.php b/src/GraphQL/DataObjectType/FieldcollectionType.php index 956268c5..c4149985 100644 --- a/src/GraphQL/DataObjectType/FieldcollectionType.php +++ b/src/GraphQL/DataObjectType/FieldcollectionType.php @@ -14,12 +14,12 @@ use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\FieldcollectionDescriptor; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Cache\RuntimeCache; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DataObjectType/ObjectTreeType.php b/src/GraphQL/DataObjectType/ObjectTreeType.php index cb6ff9d2..9a27d8b8 100644 --- a/src/GraphQL/DataObjectType/ObjectTreeType.php +++ b/src/GraphQL/DataObjectType/ObjectTreeType.php @@ -17,6 +17,8 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Bundle\DataHubBundle\GraphQL\ClassTypeDefinitions; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; @@ -24,8 +26,6 @@ use Pimcore\Bundle\DataHubBundle\PimcoreDataHubBundle; use Pimcore\Cache\RuntimeCache; use Pimcore\Model\DataObject; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DocumentType/DocumentElementType.php b/src/GraphQL/DocumentType/DocumentElementType.php index f002581b..49b0752f 100644 --- a/src/GraphQL/DocumentType/DocumentElementType.php +++ b/src/GraphQL/DocumentType/DocumentElementType.php @@ -16,10 +16,10 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; -use Pimcore\Bundle\DataHubBundle\GraphQL\Service; -use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; +use Pimcore\Bundle\DataHubBundle\GraphQL\Service; +use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; /** * @internal diff --git a/src/GraphQL/DocumentType/DocumentTreeType.php b/src/GraphQL/DocumentType/DocumentTreeType.php index 8d819d0c..f83de2fe 100644 --- a/src/GraphQL/DocumentType/DocumentTreeType.php +++ b/src/GraphQL/DocumentType/DocumentTreeType.php @@ -15,12 +15,12 @@ use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; use Pimcore\Model\Element\ElementInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/DocumentType/DocumentType.php b/src/GraphQL/DocumentType/DocumentType.php index c80bc1ee..a1cf72b6 100644 --- a/src/GraphQL/DocumentType/DocumentType.php +++ b/src/GraphQL/DocumentType/DocumentType.php @@ -16,11 +16,11 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/General/AnyDocumentTargetType.php b/src/GraphQL/General/AnyDocumentTargetType.php index 85396996..d55a3f88 100644 --- a/src/GraphQL/General/AnyDocumentTargetType.php +++ b/src/GraphQL/General/AnyDocumentTargetType.php @@ -14,11 +14,11 @@ use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/General/AnyTargetType.php b/src/GraphQL/General/AnyTargetType.php index ebdd4d30..b1a492b7 100644 --- a/src/GraphQL/General/AnyTargetType.php +++ b/src/GraphQL/General/AnyTargetType.php @@ -14,12 +14,12 @@ use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\ClassTypeDefinitions; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal diff --git a/src/GraphQL/PropertyType/ObjectsType.php b/src/GraphQL/PropertyType/ObjectsType.php index 5d283f74..9fd45c63 100644 --- a/src/GraphQL/PropertyType/ObjectsType.php +++ b/src/GraphQL/PropertyType/ObjectsType.php @@ -16,12 +16,12 @@ use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\ResolveInfo; use GraphQL\Type\Definition\UnionType; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; +use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; use Pimcore\Bundle\DataHubBundle\GraphQL\ClassTypeDefinitions; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait; use Pimcore\Model\Document; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface; -use Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareTrait; /** * @internal From 8a57949ae22c21c624670b5da810104b8db91ee7 Mon Sep 17 00:00:00 2001 From: Herbert Roth Date: Fri, 17 Oct 2025 09:14:43 +0000 Subject: [PATCH 5/6] Refactor modification date retrieval to use ParameterBagHelper --- src/Controller/ConfigController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/ConfigController.php b/src/Controller/ConfigController.php index 6706d7f0..8659ed9f 100644 --- a/src/Controller/ConfigController.php +++ b/src/Controller/ConfigController.php @@ -12,6 +12,7 @@ namespace Pimcore\Bundle\DataHubBundle\Controller; +use Pimcore\Helper\ParameterBagHelper; use Pimcore\Bundle\DataHubBundle\ConfigEvents; use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Bundle\DataHubBundle\Event\AdminEvents; @@ -377,7 +378,7 @@ public function saveAction(Request $request): ?JsonResponse try { $data = $request->request->getString('data'); - $modificationDate = $request->request->getInt('modificationDate', 0); + $modificationDate = ParameterBagHelper::getInt($request->request, 'modificationDate', 0); $dataDecoded = json_decode($data, true); From 2b0d92ef4e3bcc91e0edc738738e354e30e30702 Mon Sep 17 00:00:00 2001 From: herbertroth <126679157+herbertroth@users.noreply.github.com> Date: Fri, 17 Oct 2025 09:17:50 +0000 Subject: [PATCH 6/6] Apply php-cs-fixer changes --- src/Controller/ConfigController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/ConfigController.php b/src/Controller/ConfigController.php index 8659ed9f..60a07d55 100644 --- a/src/Controller/ConfigController.php +++ b/src/Controller/ConfigController.php @@ -12,7 +12,6 @@ namespace Pimcore\Bundle\DataHubBundle\Controller; -use Pimcore\Helper\ParameterBagHelper; use Pimcore\Bundle\DataHubBundle\ConfigEvents; use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Bundle\DataHubBundle\Event\AdminEvents; @@ -23,6 +22,7 @@ use Pimcore\Bundle\DataHubBundle\Service\ImportService; use Pimcore\Bundle\DataHubBundle\WorkspaceHelper; use Pimcore\Controller\Traits\JsonHelperTrait; +use Pimcore\Helper\ParameterBagHelper; use Pimcore\Model\Exception\ConfigWriteException; use Pimcore\Model\User; use Symfony\Component\EventDispatcher\EventDispatcherInterface;