Skip to content

Conversation

@nenes25
Copy link
Owner

@nenes25 nenes25 commented Jun 20, 2025

Remplace deprecated containerAwareCommand with dependency injection

@nenes25 nenes25 requested a review from Copilot June 20, 2025 19:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the deprecated ContainerAwareCommand usage with constructor-based dependency injection for compatibility with PrestaShop 9.

  • Commands now extend Symfony\Component\Console\Command\Command and accept their services through constructors.
  • Removed calls to $this->getContainer() and updated service definitions in services.yml.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Commands/ManageModulesCommand.php Switched to base Command, injected Manager, removed container calls
src/Commands/ListUpgradableModulesCommand.php Switched to base Command, injected ModuleRepositoryInterface
src/Commands/GeneratePatchCommand.php Switched to base Command, injected Generator
config/services.yml Added constructor arguments for commands to match new constructor signatures
Comments suppressed due to low confidence (2)

config/services.yml:66

  • The service ID does not match the injected ModuleRepositoryInterface. Ensure you reference the actual service (e.g., @prestashop.core.admin.module.repository or the correct interface service ID) so the expected repository is injected.
      - '@PrestaShop\PrestaShop\Core\Module\ModuleRepository'

src/Commands/ManageModulesCommand.php:78

  • Assigning to an undeclared dynamic property $output is deprecated in modern PHP. Declare a class property like private OutputInterface $output; to ensure proper typing and avoid dynamic properties.
            $this->output = $output;

@nenes25 nenes25 force-pushed the fix-ps-9-commands branch 3 times, most recently from fe0648c to 5bed38f Compare July 22, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants