mollie / Sylius

Mollie payment gateway integration for Sylius
MIT License
4 stars 17 forks source link

Fix some issues flagged by Symfony container linter. #6

Closed markbeazley closed 1 year ago

markbeazley commented 1 year ago

After running the Symfony php bin/console lint:container command to check the service container, it flagged a couple of issues

  1. The service definition sylius_mollie_plugin.resolver.mollie_amount_restriction_resolver references a class that doesn't exist, and I can't see anything that requires that service so I've removed it.
  2. MollieGatewayConfigFactoryInterface doesn't extend Sylius\Component\Resource\Factory\FactoryInterface which was causing this error:
    [ERROR] Invalid definition for service "sylius_mollie_plugin.controller.mollie_gateway_config": argument 5 of          
         "Sylius\Bundle\ResourceBundle\Controller\ResourceController::__construct()" accepts                            
         "Sylius\Component\Resource\Factory\FactoryInterface", "SyliusMolliePlugin\Factory\MollieGatewayConfigFactory"  
         passed.

    So changed it to extend the FactoryInterface and implemented the createNew() method by calling the inner factory class.

sebastian-mollie commented 1 year ago

Merged with another pull request, closing the PR