diff --git a/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php b/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php index d0d6038..eca43b6 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Command/UpdateSubscriptionsCommand.php @@ -62,24 +62,13 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand private $progress; - public function setLogger(LoggerInterface $logger): void + public function setDeps(LoggerInterface $logger, EntityManagerInterface $em, UserRepository $userRepo, UserApi $userApi, SubscriptionsManager $subscriptionsManager): void { $this->logger = $logger; - } - - public function setEntityManager(EntityManagerInterface $em): void - { $this->em = $em; - } - - public function setUserRepository(UserRepository $repository): void - { - $this->userRepo = $repository; - } - - public function setApiClient(UserApi $userApi): void - { + $this->userRepo = $userRepo; $this->api = $userApi; + $this->subscriptionManager = $subscriptionsManager; } public function setApiDelay(int $microSecs): void @@ -87,11 +76,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand $this->apiDelay = $microSecs; } - public function setSubscriptionManager(SubscriptionsManager $subscriptionsManager): void - { - $this->subscriptionManager = $subscriptionsManager; - } - protected function configure() { $this @@ -109,7 +93,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand InputOption::VALUE_NONE, 'If set, command will not perform write operations in the database' ) - // @todo add option for checking only selected user ; } diff --git a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml index 56e737f..741fa69 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml +++ b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml @@ -55,12 +55,8 @@ services: class: Skobkin\Bundle\PointToolsBundle\Command\UpdateSubscriptionsCommand #autowire: [] calls: - - [setLogger, ['@logger']] - - [setEntityManager, ['@doctrine.orm.entity_manager']] - - [setUserRepository, ['@app.point.user_repository']] - - [setApiClient, ['@app.point.api_user']] + - [setDeps, ['@logger', '@doctrine.orm.entity_manager', '@app.point.user_repository', '@app.point.api_user', '@app.point.subscriptions_manager']] - [setApiDelay, ['%point_api_delay%']] - - [setSubscriptionManager, ['@app.point.subscriptions_manager']] tags: - { name: console.command } - { name: monolog.logger, channel: subscribers_update }