aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Event
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Event')
-rw-r--r--src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php3
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php5
4 files changed, 5 insertions, 22 deletions
diff --git a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
index 367cdfb0..1b5d61ad 100644
--- a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
+++ b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
@@ -6,8 +6,10 @@ use Symfony\Component\HttpFoundation\Session\Session;
6use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; 6use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
7 7
8/** 8/**
9 * Stores the locale of the user in the session after the 9 * Stores the locale of the user in the session after the login.
10 * login. This can be used by the LocaleListener afterwards. 10 * If no locale are defined (if user doesn't change it from the login screen), override it with the user's config one.
11 *
12 * This can be used by the LocaleListener afterwards.
11 * 13 *
12 * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html 14 * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html
13 */ 15 */
@@ -23,14 +25,11 @@ class UserLocaleListener
23 $this->session = $session; 25 $this->session = $session;
24 } 26 }
25 27
26 /**
27 * @param InteractiveLoginEvent $event
28 */
29 public function onInteractiveLogin(InteractiveLoginEvent $event) 28 public function onInteractiveLogin(InteractiveLoginEvent $event)
30 { 29 {
31 $user = $event->getAuthenticationToken()->getUser(); 30 $user = $event->getAuthenticationToken()->getUser();
32 31
33 if (null !== $user->getConfig()->getLanguage()) { 32 if (null !== $user->getConfig()->getLanguage() && null === $this->session->get('_locale')) {
34 $this->session->set('_locale', $user->getConfig()->getLanguage()); 33 $this->session->set('_locale', $user->getConfig()->getLanguage());
35 } 34 }
36 } 35 }
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
index cabb3eca..b8f6e1d6 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
@@ -12,9 +12,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
12 */ 12 */
13class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface 13class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface
14{ 14{
15 /**
16 * @param GetFilterConditionEvent $event
17 */
18 public function filterDateRange(GetFilterConditionEvent $event) 15 public function filterDateRange(GetFilterConditionEvent $event)
19 { 16 {
20 $expr = $event->getFilterQuery()->getExpressionBuilder(); 17 $expr = $event->getFilterQuery()->getExpressionBuilder();
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
index 1dd0a1a4..ef8d7d3b 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php
@@ -35,8 +35,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
35 35
36 /** 36 /**
37 * Download images and updated the data into the entry. 37 * Download images and updated the data into the entry.
38 *
39 * @param EntrySavedEvent $event
40 */ 38 */
41 public function onEntrySaved(EntrySavedEvent $event) 39 public function onEntrySaved(EntrySavedEvent $event)
42 { 40 {
@@ -69,8 +67,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
69 67
70 /** 68 /**
71 * Remove images related to the entry. 69 * Remove images related to the entry.
72 *
73 * @param EntryDeletedEvent $event
74 */ 70 */
75 public function onEntryDeleted(EntryDeletedEvent $event) 71 public function onEntryDeleted(EntryDeletedEvent $event)
76 { 72 {
@@ -88,8 +84,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
88 * 84 *
89 * @todo If we want to add async download, it should be done in that method 85 * @todo If we want to add async download, it should be done in that method
90 * 86 *
91 * @param Entry $entry
92 *
93 * @return string|false False in case of async 87 * @return string|false False in case of async
94 */ 88 */
95 private function downloadImages(Entry $entry) 89 private function downloadImages(Entry $entry)
@@ -106,8 +100,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
106 * 100 *
107 * @todo If we want to add async download, it should be done in that method 101 * @todo If we want to add async download, it should be done in that method
108 * 102 *
109 * @param Entry $entry
110 *
111 * @return string|false False in case of async 103 * @return string|false False in case of async
112 */ 104 */
113 private function downloadPreviewImage(Entry $entry) 105 private function downloadPreviewImage(Entry $entry)
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
index 9c1d8a1d..dcadeedf 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
@@ -18,9 +18,6 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
18{ 18{
19 private $doctrine; 19 private $doctrine;
20 20
21 /**
22 * @param \Doctrine\Bundle\DoctrineBundle\Registry $doctrine
23 */
24 public function __construct(Registry $doctrine) 21 public function __construct(Registry $doctrine)
25 { 22 {
26 $this->doctrine = $doctrine; 23 $this->doctrine = $doctrine;
@@ -39,8 +36,6 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
39 /** 36 /**
40 * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own. 37 * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own.
41 * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone). 38 * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone).
42 *
43 * @param LifecycleEventArgs $args
44 */ 39 */
45 public function preRemove(LifecycleEventArgs $args) 40 public function preRemove(LifecycleEventArgs $args)
46 { 41 {