diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
commit | f808b01692a835673f328d7221ba8c212caa9b61 (patch) | |
tree | 0c3b1fc5b1ddbd7af72227303503177689e1d403 /src/Wallabag/ImportBundle/Command | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
download | wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.gz wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.zst wallabag-f808b01692a835673f328d7221ba8c212caa9b61.zip |
Add a real configuration for CS-Fixer
Diffstat (limited to 'src/Wallabag/ImportBundle/Command')
-rw-r--r-- | src/Wallabag/ImportBundle/Command/ImportCommand.php | 10 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php index 5f1ab0af..99056c2c 100644 --- a/src/Wallabag/ImportBundle/Command/ImportCommand.php +++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php | |||
@@ -5,8 +5,8 @@ namespace Wallabag\ImportBundle\Command; | |||
5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | 5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
6 | use Symfony\Component\Config\Definition\Exception\Exception; | 6 | use Symfony\Component\Config\Definition\Exception\Exception; |
7 | use Symfony\Component\Console\Input\InputArgument; | 7 | use Symfony\Component\Console\Input\InputArgument; |
8 | use Symfony\Component\Console\Input\InputOption; | ||
9 | use Symfony\Component\Console\Input\InputInterface; | 8 | use Symfony\Component\Console\Input\InputInterface; |
9 | use Symfony\Component\Console\Input\InputOption; | ||
10 | use Symfony\Component\Console\Output\OutputInterface; | 10 | use Symfony\Component\Console\Output\OutputInterface; |
11 | 11 | ||
12 | class ImportCommand extends ContainerAwareCommand | 12 | class ImportCommand extends ContainerAwareCommand |
@@ -27,7 +27,7 @@ class ImportCommand extends ContainerAwareCommand | |||
27 | 27 | ||
28 | protected function execute(InputInterface $input, OutputInterface $output) | 28 | protected function execute(InputInterface $input, OutputInterface $output) |
29 | { | 29 | { |
30 | $output->writeln('Start : '.(new \DateTime())->format('d-m-Y G:i:s').' ---'); | 30 | $output->writeln('Start : ' . (new \DateTime())->format('d-m-Y G:i:s') . ' ---'); |
31 | 31 | ||
32 | if (!file_exists($input->getArgument('filepath'))) { | 32 | if (!file_exists($input->getArgument('filepath'))) { |
33 | throw new Exception(sprintf('File "%s" not found', $input->getArgument('filepath'))); | 33 | throw new Exception(sprintf('File "%s" not found', $input->getArgument('filepath'))); |
@@ -80,12 +80,12 @@ class ImportCommand extends ContainerAwareCommand | |||
80 | 80 | ||
81 | if (true === $res) { | 81 | if (true === $res) { |
82 | $summary = $import->getSummary(); | 82 | $summary = $import->getSummary(); |
83 | $output->writeln('<info>'.$summary['imported'].' imported</info>'); | 83 | $output->writeln('<info>' . $summary['imported'] . ' imported</info>'); |
84 | $output->writeln('<comment>'.$summary['skipped'].' already saved</comment>'); | 84 | $output->writeln('<comment>' . $summary['skipped'] . ' already saved</comment>'); |
85 | } | 85 | } |
86 | 86 | ||
87 | $em->clear(); | 87 | $em->clear(); |
88 | 88 | ||
89 | $output->writeln('End : '.(new \DateTime())->format('d-m-Y G:i:s').' ---'); | 89 | $output->writeln('End : ' . (new \DateTime())->format('d-m-Y G:i:s') . ' ---'); |
90 | } | 90 | } |
91 | } | 91 | } |
diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php index 2d06af44..d94900ad 100644 --- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php +++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php | |||
@@ -2,13 +2,13 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Command; | 3 | namespace Wallabag\ImportBundle\Command; |
4 | 4 | ||
5 | use Simpleue\Worker\QueueWorker; | ||
5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | 6 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
6 | use Symfony\Component\Config\Definition\Exception\Exception; | 7 | use Symfony\Component\Config\Definition\Exception\Exception; |
7 | use Symfony\Component\Console\Input\InputArgument; | 8 | use Symfony\Component\Console\Input\InputArgument; |
8 | use Symfony\Component\Console\Input\InputOption; | ||
9 | use Symfony\Component\Console\Input\InputInterface; | 9 | use Symfony\Component\Console\Input\InputInterface; |
10 | use Symfony\Component\Console\Input\InputOption; | ||
10 | use Symfony\Component\Console\Output\OutputInterface; | 11 | use Symfony\Component\Console\Output\OutputInterface; |
11 | use Simpleue\Worker\QueueWorker; | ||
12 | 12 | ||
13 | class RedisWorkerCommand extends ContainerAwareCommand | 13 | class RedisWorkerCommand extends ContainerAwareCommand |
14 | { | 14 | { |
@@ -24,18 +24,18 @@ class RedisWorkerCommand extends ContainerAwareCommand | |||
24 | 24 | ||
25 | protected function execute(InputInterface $input, OutputInterface $output) | 25 | protected function execute(InputInterface $input, OutputInterface $output) |
26 | { | 26 | { |
27 | $output->writeln('Worker started at: '.(new \DateTime())->format('d-m-Y G:i:s')); | 27 | $output->writeln('Worker started at: ' . (new \DateTime())->format('d-m-Y G:i:s')); |
28 | $output->writeln('Waiting for message ...'); | 28 | $output->writeln('Waiting for message ...'); |
29 | 29 | ||
30 | $serviceName = $input->getArgument('serviceName'); | 30 | $serviceName = $input->getArgument('serviceName'); |
31 | 31 | ||
32 | if (!$this->getContainer()->has('wallabag_import.queue.redis.'.$serviceName) || !$this->getContainer()->has('wallabag_import.consumer.redis.'.$serviceName)) { | 32 | if (!$this->getContainer()->has('wallabag_import.queue.redis.' . $serviceName) || !$this->getContainer()->has('wallabag_import.consumer.redis.' . $serviceName)) { |
33 | throw new Exception(sprintf('No queue or consumer found for service name: "%s"', $input->getArgument('serviceName'))); | 33 | throw new Exception(sprintf('No queue or consumer found for service name: "%s"', $input->getArgument('serviceName'))); |
34 | } | 34 | } |
35 | 35 | ||
36 | $worker = new QueueWorker( | 36 | $worker = new QueueWorker( |
37 | $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), | 37 | $this->getContainer()->get('wallabag_import.queue.redis.' . $serviceName), |
38 | $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), | 38 | $this->getContainer()->get('wallabag_import.consumer.redis.' . $serviceName), |
39 | (int) $input->getOption('maxIterations') | 39 | (int) $input->getOption('maxIterations') |
40 | ); | 40 | ); |
41 | 41 | ||