UpdateSubscriptionsCommand dependency setting minified.

This commit is contained in:
Alexey Skobkin 2017-01-21 01:35:25 +03:00
parent 845097f7ea
commit 013fb3ef3d
2 changed files with 4 additions and 25 deletions

View file

@ -62,24 +62,13 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
private $progress; 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; $this->logger = $logger;
}
public function setEntityManager(EntityManagerInterface $em): void
{
$this->em = $em; $this->em = $em;
} $this->userRepo = $userRepo;
public function setUserRepository(UserRepository $repository): void
{
$this->userRepo = $repository;
}
public function setApiClient(UserApi $userApi): void
{
$this->api = $userApi; $this->api = $userApi;
$this->subscriptionManager = $subscriptionsManager;
} }
public function setApiDelay(int $microSecs): void public function setApiDelay(int $microSecs): void
@ -87,11 +76,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
$this->apiDelay = $microSecs; $this->apiDelay = $microSecs;
} }
public function setSubscriptionManager(SubscriptionsManager $subscriptionsManager): void
{
$this->subscriptionManager = $subscriptionsManager;
}
protected function configure() protected function configure()
{ {
$this $this
@ -109,7 +93,6 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
InputOption::VALUE_NONE, InputOption::VALUE_NONE,
'If set, command will not perform write operations in the database' 'If set, command will not perform write operations in the database'
) )
// @todo add option for checking only selected user
; ;
} }

View file

@ -55,12 +55,8 @@ services:
class: Skobkin\Bundle\PointToolsBundle\Command\UpdateSubscriptionsCommand class: Skobkin\Bundle\PointToolsBundle\Command\UpdateSubscriptionsCommand
#autowire: [] #autowire: []
calls: calls:
- [setLogger, ['@logger']] - [setDeps, ['@logger', '@doctrine.orm.entity_manager', '@app.point.user_repository', '@app.point.api_user', '@app.point.subscriptions_manager']]
- [setEntityManager, ['@doctrine.orm.entity_manager']]
- [setUserRepository, ['@app.point.user_repository']]
- [setApiClient, ['@app.point.api_user']]
- [setApiDelay, ['%point_api_delay%']] - [setApiDelay, ['%point_api_delay%']]
- [setSubscriptionManager, ['@app.point.subscriptions_manager']]
tags: tags:
- { name: console.command } - { name: console.command }
- { name: monolog.logger, channel: subscribers_update } - { name: monolog.logger, channel: subscribers_update }