]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix getContainer in command
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 10 Jun 2017 11:19:43 +0000 (13:19 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 21 Jun 2017 09:44:35 +0000 (11:44 +0200)
src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
src/Wallabag/CoreBundle/Command/ExportCommand.php
src/Wallabag/CoreBundle/Command/ShowUserCommand.php
src/Wallabag/CoreBundle/Command/TagAllCommand.php
src/Wallabag/CoreBundle/Controller/ExportController.php

index 89ae7998da64f6bc5f51b80c074fb2d6c92474f2..74da1e5f5292fe388eab92c8f701b990de018019 100644 (file)
@@ -46,7 +46,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
                 return 1;
             }
         } else {
-            $users = $this->get('wallabag_user.user_repository')->findAll();
+            $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
 
             $output->writeln(sprintf('Cleaning through %d user accounts', count($users)));
 
@@ -66,7 +66,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
     private function cleanDuplicates(User $user)
     {
         $em = $this->getContainer()->get('doctrine.orm.entity_manager');
-        $repo = $this->get('wallabag_core.entry_repository');
+        $repo = $this->getContainer()->get('wallabag_core.entry_repository');
 
         $entries = $repo->getAllEntriesIdAndUrl($user->getId());
 
@@ -109,7 +109,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
      */
     private function getUser($username)
     {
-        return $this->get('wallabag_user.user_repository')->findOneByUserName($username);
+        return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
     }
 
     private function getDoctrine()
index e4977e11e9dd290e574656361691ca7452fd35d0..ebb2b4cff7124eb81ddc3c70ebdc869aa357fbb2 100644 (file)
@@ -32,14 +32,14 @@ class ExportCommand extends ContainerAwareCommand
     protected function execute(InputInterface $input, OutputInterface $output)
     {
         try {
-            $user = $this->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
+            $user = $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($input->getArgument('username'));
         } catch (NoResultException $e) {
             $output->writeln(sprintf('<error>User "%s" not found.</error>', $input->getArgument('username')));
 
             return 1;
         }
 
-        $entries = $this->get('wallabag_core.entry_repository')
+        $entries = $this->getContainer()->get('wallabag_core.entry_repository')
             ->getBuilderForAllByUser($user->getId())
             ->getQuery()
             ->getResult();
index 90a7e03f213004586291e4848774b9a5a838ccf0..eef04988fb80206d67bdf8c8a242299e188001b0 100644 (file)
@@ -67,7 +67,7 @@ class ShowUserCommand extends ContainerAwareCommand
      */
     private function getUser($username)
     {
-        return $this->get('wallabag_user.user_repository')->findOneByUserName($username);
+        return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
     }
 
     private function getDoctrine()
index 5a6dc04e359d963c160f629d1f115e2ffe262f68..9843674e23980173e46f41b30f6d158c8c75fc00 100644 (file)
@@ -59,7 +59,7 @@ class TagAllCommand extends ContainerAwareCommand
      */
     private function getUser($username)
     {
-        return $this->get('wallabag_user.user_repository')->findOneByUserName($username);
+        return $this->getContainer()->get('wallabag_user.user_repository')->findOneByUserName($username);
     }
 
     private function getDoctrine()
index b9e5a974acede4fc9d5f8cbcce36e3f1561b10c4..e61b6d3200e6c3ebfe1d484f749414ac0c770cbd 100644 (file)
@@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Entity\Tag;
 
 /**
  * The try/catch can be removed once all formats will be implemented.