Skip to content

Conversation

@herbertroth
Copy link
Member

@herbertroth herbertroth commented Oct 13, 2025

This pull request makes several improvements to command registration and code consistency, as well as updates to GraphQL type classes for dependency injection. The most significant changes are the migration to Symfony's attribute-based command registration, explicit return type declarations, and the replacement of Symfony's dependency injection interfaces with Pimcore's equivalents in GraphQL type classes.

Command Registration and Configuration

  • Migrated command registration in MigrateLegacyConfig and RebuildWorkspacesCommand from method-based configuration to the Symfony AsCommand attribute, simplifying command definitions. [1] [2]
  • Removed legacy configuration code from the configure() methods in both command classes, as configuration is now handled by attributes. [1] [2]

Code Consistency and Type Safety

  • Updated the execute methods in both command classes to explicitly declare int as the return type, aligning with Symfony standards and improving type safety. [1] [2]
  • In ConfigController, replaced direct request parameter access with ParameterBagHelper::getInt for safer integer retrieval.

Dependency Injection in GraphQL Types

  • Replaced usage of Symfony\Component\DependencyInjection\ContainerAwareInterface and ContainerAwareTrait with Pimcore's equivalents (Pimcore\Bundle\CoreBundle\DependencyInjection\ContainerAwareInterface and ContainerAwareTrait) across multiple GraphQL type classes for consistency within the Pimcore codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Removed redundant property declarations for $container in DocumentElementType, as the trait now handles this.

@herbertroth herbertroth self-assigned this Oct 13, 2025
@herbertroth herbertroth added this to the 2.3.0 milestone Oct 13, 2025
@sonarqubecloud
Copy link

@herbertroth herbertroth changed the title Refactor command configuration to use attributes instead of method calls Symfony7 next steps Oct 22, 2025
@herbertroth herbertroth marked this pull request as ready for review October 22, 2025 07:18
@herbertroth herbertroth merged commit 73cc96d into 2.x Oct 22, 2025
1 check passed
@herbertroth herbertroth deleted the symfony7-next-steps branch October 22, 2025 13:28
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants