Skip to content

Commit

Permalink
Remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Oct 2, 2024
1 parent ab3aa04 commit 7471b30
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
- The file `@WebgriffeSyliusClerkPlugin/Resources/config/shop_routing.yml` has been removed. Use `@WebgriffeSyliusClerkPlugin/config/shop_routing.php` instead.
- The file `@WebgriffeSyliusClerkPlugin/Resources/config/admin_routing.yml` has been removed.
- The file `@WebgriffeSyliusClerkPlugin/Resources/config/feed_routing.yml` has been removed. Use `@WebgriffeSyliusClerkPlugin/config/feed_routing.php` instead.
- The parameter `webgriffe_sylius_clerk.storage_feed_path` has been removed.
9 changes: 4 additions & 5 deletions config/services/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@

$services->set('webgriffe_sylius_clerk.command.generate_feed', FeedGeneratorCommand::class)
->args([
service(FeedGenerator::class),
service('sylius.repository.channel'),
service('router'),
service('monolog.logger'),
param('webgriffe_sylius_clerk.storage_feed_path'),
'$feedGenerator' => service(FeedGenerator::class),
'$channelRepository' => service('sylius.repository.channel'),
'$router' => service('router'),
'$logger' => service('monolog.logger'),
])
->tag('console.command')
;
Expand Down
18 changes: 10 additions & 8 deletions src/Command/FeedGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,21 @@ final class FeedGeneratorCommand extends Command
private ?OutputInterface $output = null;

public function __construct(
private FeedGeneratorInterface $feedGenerator,
private ChannelRepositoryInterface $channelRepository,
private RouterInterface $router,
private LoggerInterface $logger,
private string $storagePath,
private readonly FeedGeneratorInterface $feedGenerator,
private readonly ChannelRepositoryInterface $channelRepository,
private readonly RouterInterface $router,
private readonly LoggerInterface $logger,
private readonly string $storagePath,
) {
parent::__construct();
parent::__construct(self::$defaultName);
}

protected function configure(): void
{
$this->setDescription('Generate JSON feed for Clerk.io')
->addArgument('channelCode', InputArgument::REQUIRED, 'Channel code');
$this
->setDescription('Generate JSON feed for Clerk.io')
->addArgument('channelCode', InputArgument::REQUIRED, 'Channel code')
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/WebgriffeSyliusClerkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public function load(array $configs, ContainerBuilder $container): void
$publicApiKeyProviderServiceDefinition = $container->getDefinition('webgriffe_sylius_clerk.provider.public_api_key');
$publicApiKeyProviderServiceDefinition->setArgument('$clerkStores', $config['stores']);

$container->setParameter('webgriffe_sylius_clerk.storage_feed_path', (string) $config['storage_feed_path']);
$generateFeedCommand = $container->getDefinition('webgriffe_sylius_clerk.command.generate_feed');
$generateFeedCommand->setArgument('$storagePath', $config['storage_feed_path']);
}

public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
Expand Down

0 comments on commit 7471b30

Please sign in to comment.