aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-10-09 16:47:15 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-10-09 16:47:15 +0200
commit3ef055ced3d6ea0d2f15ba660602545f477e9c3c (patch)
tree800dfcf6cd276650cfc6626d641e4fbf65a0bb68 /src/Wallabag/CoreBundle/Controller
parentf40c88eb1fa349aab600f9c1c94364f317fe62dd (diff)
downloadwallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.tar.gz
wallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.tar.zst
wallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.zip
CS
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 7e39992d..a89bb780 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -348,7 +348,7 @@ class ConfigController extends Controller
348 $em = $this->getDoctrine()->getManager(); 348 $em = $this->getDoctrine()->getManager();
349 349
350 foreach ($tags as $tag) { 350 foreach ($tags as $tag) {
351 if (count($tag->getEntries()) === 0) { 351 if (0 === count($tag->getEntries())) {
352 $em->remove($tag); 352 $em->remove($tag);
353 } 353 }
354 } 354 }
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index b0b74c38..840dc254 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -195,7 +195,7 @@ class EntryController extends Controller
195 public function showUnreadAction(Request $request, $page) 195 public function showUnreadAction(Request $request, $page)
196 { 196 {
197 // load the quickstart if no entry in database 197 // load the quickstart if no entry in database
198 if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) { 198 if (1 === (int) $page && 0 === $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId())) {
199 return $this->redirect($this->generateUrl('quickstart')); 199 return $this->redirect($this->generateUrl('quickstart'));
200 } 200 }
201 201
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 35a22046..7ca89239 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -59,7 +59,7 @@ class ExportController extends Controller
59 $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; 59 $methodBuilder = 'getBuilderFor' . $method . 'ByUser';
60 $repository = $this->get('wallabag_core.entry_repository'); 60 $repository = $this->get('wallabag_core.entry_repository');
61 61
62 if ($category === 'tag_entries') { 62 if ('tag_entries' === $category) {
63 $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); 63 $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
64 64
65 $entries = $repository->findAllByTagId( 65 $entries = $repository->findAllByTagId(
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index be2dff98..616c37f2 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -65,7 +65,7 @@ class TagController extends Controller
65 $em->flush(); 65 $em->flush();
66 66
67 // remove orphan tag in case no entries are associated to it 67 // remove orphan tag in case no entries are associated to it
68 if (count($tag->getEntries()) === 0) { 68 if (0 === count($tag->getEntries())) {
69 $em->remove($tag); 69 $em->remove($tag);
70 $em->flush(); 70 $em->flush();
71 } 71 }