]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Command/ShowUserCommand.php
User existing service instead of getDoctrine
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Command / ShowUserCommand.php
index 10428c4be8674266a2c6069f55e688eefb5d2175..90a7e03f213004586291e4848774b9a5a838ccf0 100644 (file)
@@ -53,9 +53,9 @@ class ShowUserCommand extends ContainerAwareCommand
         $this->output->writeln(sprintf('Username : %s', $user->getUsername()));
         $this->output->writeln(sprintf('Email : %s', $user->getEmail()));
         $this->output->writeln(sprintf('Display name : %s', $user->getName()));
-        $this->output->writeln(sprintf('Creation date : %s', $user->getCreatedAt() !== null ? $user->getCreatedAt()->format('Y-m-d H:i:s') : 'false'));
-        $this->output->writeln(sprintf('Last login : %s', $user->getLastLogin() !== null ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'false'));
-        $this->output->writeln(sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'true' : 'false'));
+        $this->output->writeln(sprintf('Creation date : %s', $user->getCreatedAt()->format('Y-m-d H:i:s')));
+        $this->output->writeln(sprintf('Last login : %s', $user->getLastLogin() !== null ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'));
+        $this->output->writeln(sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'));
     }
 
     /**
@@ -67,7 +67,7 @@ class ShowUserCommand extends ContainerAwareCommand
      */
     private function getUser($username)
     {
-        return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
+        return $this->get('wallabag_user.user_repository')->findOneByUserName($username);
     }
 
     private function getDoctrine()