aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/DeveloperController.php4
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php22
2 files changed, 13 insertions, 13 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/DeveloperController.php
index 1ea220e5..63386db0 100644
--- a/src/Wallabag/CoreBundle/Controller/DeveloperController.php
+++ b/src/Wallabag/CoreBundle/Controller/DeveloperController.php
@@ -49,7 +49,7 @@ class DeveloperController extends Controller
49 49
50 $this->get('session')->getFlashBag()->add( 50 $this->get('session')->getFlashBag()->add(
51 'notice', 51 'notice',
52 $this->get('translator')->trans('flashes.developer.notice.client_created', array('%name%' => $client->getName())) 52 $this->get('translator')->trans('flashes.developer.notice.client_created', ['%name%' => $client->getName()])
53 ); 53 );
54 54
55 return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', [ 55 return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', [
@@ -81,7 +81,7 @@ class DeveloperController extends Controller
81 81
82 $this->get('session')->getFlashBag()->add( 82 $this->get('session')->getFlashBag()->add(
83 'notice', 83 'notice',
84 $this->get('translator')->trans('flashes.developer.notice.client_deleted', array('%name%' => $client->getName())) 84 $this->get('translator')->trans('flashes.developer.notice.client_deleted', ['%name%' => $client->getName()])
85 ); 85 );
86 86
87 return $this->redirect($this->generateUrl('developer')); 87 return $this->redirect($this->generateUrl('developer'));
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
index 5c475d61..93640dc6 100644
--- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
+++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
@@ -33,31 +33,31 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
33 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; 33 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
34 34
35 if (null === $user || !is_object($user)) { 35 if (null === $user || !is_object($user)) {
36 return array(); 36 return [];
37 } 37 }
38 38
39 $unreadEntries = $this->repository->enableCache( 39 $unreadEntries = $this->repository->enableCache(
40 $this->repository->getBuilderForUnreadByUser($user->getId())->getQuery() 40 $this->repository->getBuilderForUnreadByUser($user->getId())->select('COUNT(e.id)')->getQuery()
41 ); 41 );
42 42
43 $starredEntries = $this->repository->enableCache( 43 $starredEntries = $this->repository->enableCache(
44 $this->repository->getBuilderForStarredByUser($user->getId())->getQuery() 44 $this->repository->getBuilderForStarredByUser($user->getId())->select('COUNT(e.id)')->getQuery()
45 ); 45 );
46 46
47 $archivedEntries = $this->repository->enableCache( 47 $archivedEntries = $this->repository->enableCache(
48 $this->repository->getBuilderForArchiveByUser($user->getId())->getQuery() 48 $this->repository->getBuilderForArchiveByUser($user->getId())->select('COUNT(e.id)')->getQuery()
49 ); 49 );
50 50
51 $allEntries = $this->repository->enableCache( 51 $allEntries = $this->repository->enableCache(
52 $this->repository->getBuilderForAllByUser($user->getId())->getQuery() 52 $this->repository->getBuilderForAllByUser($user->getId())->select('COUNT(e.id)')->getQuery()
53 ); 53 );
54 54
55 return array( 55 return [
56 'unreadEntries' => count($unreadEntries->getResult()), 56 'unreadEntries' => $unreadEntries->getSingleScalarResult(),
57 'starredEntries' => count($starredEntries->getResult()), 57 'starredEntries' => $starredEntries->getSingleScalarResult(),
58 'archivedEntries' => count($archivedEntries->getResult()), 58 'archivedEntries' => $archivedEntries->getSingleScalarResult(),
59 'allEntries' => count($allEntries->getResult()), 59 'allEntries' => $allEntries->getSingleScalarResult(),
60 ); 60 ];
61 } 61 }
62 62
63 public function getName() 63 public function getName()