aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php21
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php14
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php8
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php6
4 files changed, 25 insertions, 24 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 7a187710..d0cf91de 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -4,17 +4,18 @@ namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\JsonResponse; 7use Symfony\Component\HttpFoundation\JsonResponse;
8use Symfony\Component\HttpFoundation\Request;
9use Wallabag\CoreBundle\Entity\Config; 9use Wallabag\CoreBundle\Entity\Config;
10use Wallabag\CoreBundle\Entity\TaggingRule; 10use Wallabag\CoreBundle\Entity\TaggingRule;
11use Wallabag\UserBundle\Entity\User; 11use Wallabag\CoreBundle\Form\Type\ConfigType;
12use Wallabag\CoreBundle\Form\Type\ChangePasswordType; 12use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
13use Wallabag\CoreBundle\Form\Type\UserInformationType;
14use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
15use Wallabag\CoreBundle\Form\Type\NewUserType; 13use Wallabag\CoreBundle\Form\Type\NewUserType;
16use Wallabag\CoreBundle\Form\Type\RssType; 14use Wallabag\CoreBundle\Form\Type\RssType;
15use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
16use Wallabag\CoreBundle\Form\Type\UserInformationType;
17use Wallabag\CoreBundle\Tools\Utils; 17use Wallabag\CoreBundle\Tools\Utils;
18use Wallabag\UserBundle\Entity\User;
18 19
19class ConfigController extends Controller 20class ConfigController extends Controller
20{ 21{
@@ -31,7 +32,7 @@ class ConfigController extends Controller
31 $user = $this->getUser(); 32 $user = $this->getUser();
32 33
33 // handle basic config detail (this form is defined as a service) 34 // handle basic config detail (this form is defined as a service)
34 $configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config'))); 35 $configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config')));
35 $configForm->handleRequest($request); 36 $configForm->handleRequest($request);
36 37
37 if ($configForm->isValid()) { 38 if ($configForm->isValid()) {
@@ -51,7 +52,7 @@ class ConfigController extends Controller
51 } 52 }
52 53
53 // handle changing password 54 // handle changing password
54 $pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4')); 55 $pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4'));
55 $pwdForm->handleRequest($request); 56 $pwdForm->handleRequest($request);
56 57
57 if ($pwdForm->isValid()) { 58 if ($pwdForm->isValid()) {
@@ -67,7 +68,7 @@ class ConfigController extends Controller
67 } 68 }
68 69
69 // handle changing user information 70 // handle changing user information
70 $userForm = $this->createForm(new UserInformationType(), $user, array( 71 $userForm = $this->createForm(UserInformationType::class, $user, array(
71 'validation_groups' => array('Profile'), 72 'validation_groups' => array('Profile'),
72 'action' => $this->generateUrl('config').'#set3', 73 'action' => $this->generateUrl('config').'#set3',
73 )); 74 ));
@@ -85,7 +86,7 @@ class ConfigController extends Controller
85 } 86 }
86 87
87 // handle rss information 88 // handle rss information
88 $rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2')); 89 $rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
89 $rssForm->handleRequest($request); 90 $rssForm->handleRequest($request);
90 91
91 if ($rssForm->isValid()) { 92 if ($rssForm->isValid()) {
@@ -102,7 +103,7 @@ class ConfigController extends Controller
102 103
103 // handle tagging rule 104 // handle tagging rule
104 $taggingRule = new TaggingRule(); 105 $taggingRule = new TaggingRule();
105 $newTaggingRule = $this->createForm(new TaggingRuleType(), $taggingRule, array('action' => $this->generateUrl('config').'#set5')); 106 $newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
106 $newTaggingRule->handleRequest($request); 107 $newTaggingRule->handleRequest($request);
107 108
108 if ($newTaggingRule->isValid()) { 109 if ($newTaggingRule->isValid()) {
@@ -122,7 +123,7 @@ class ConfigController extends Controller
122 $newUser = $userManager->createUser(); 123 $newUser = $userManager->createUser();
123 // enable created user by default 124 // enable created user by default
124 $newUser->setEnabled(true); 125 $newUser->setEnabled(true);
125 $newUserForm = $this->createForm(new NewUserType(), $newUser, array( 126 $newUserForm = $this->createForm(NewUserType::class, $newUser, array(
126 'validation_groups' => array('Profile'), 127 'validation_groups' => array('Profile'),
127 'action' => $this->generateUrl('config').'#set5', 128 'action' => $this->generateUrl('config').'#set5',
128 )); 129 ));
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 1949bdf8..9dd904f1 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -2,16 +2,16 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Pagerfanta\Adapter\DoctrineORMAdapter;
6use Pagerfanta\Pagerfanta;
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 8use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 10use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
9use Wallabag\CoreBundle\Entity\Entry; 11use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Form\Type\NewEntryType;
11use Wallabag\CoreBundle\Form\Type\EditEntryType;
12use Wallabag\CoreBundle\Filter\EntryFilterType; 12use Wallabag\CoreBundle\Filter\EntryFilterType;
13use Pagerfanta\Adapter\DoctrineORMAdapter; 13use Wallabag\CoreBundle\Form\Type\EditEntryType;
14use Pagerfanta\Pagerfanta; 14use Wallabag\CoreBundle\Form\Type\NewEntryType;
15 15
16class EntryController extends Controller 16class EntryController extends Controller
17{ 17{
@@ -43,7 +43,7 @@ class EntryController extends Controller
43 { 43 {
44 $entry = new Entry($this->getUser()); 44 $entry = new Entry($this->getUser());
45 45
46 $form = $this->createForm(new NewEntryType(), $entry); 46 $form = $this->createForm(NewEntryType::class, $entry);
47 47
48 $form->handleRequest($request); 48 $form->handleRequest($request);
49 49
@@ -116,7 +116,7 @@ class EntryController extends Controller
116 { 116 {
117 $this->checkUserAction($entry); 117 $this->checkUserAction($entry);
118 118
119 $form = $this->createForm(new EditEntryType(), $entry); 119 $form = $this->createForm(EditEntryType::class, $entry);
120 120
121 $form->handleRequest($request); 121 $form->handleRequest($request);
122 122
@@ -238,7 +238,7 @@ class EntryController extends Controller
238 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); 238 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
239 } 239 }
240 240
241 $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser())); 241 $form = $this->createForm(EntryFilterType::class);
242 242
243 if ($request->query->has($form->getName())) { 243 if ($request->query->has($form->getName())) {
244 // manually bind values from the request 244 // manually bind values from the request
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 023a6228..2b7ef598 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -2,13 +2,13 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 5use Pagerfanta\Adapter\DoctrineORMAdapter;
6use Pagerfanta\Pagerfanta;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7use Symfony\Bundle\FrameworkBundle\Controller\Controller; 9use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8use Wallabag\UserBundle\Entity\User;
9use Wallabag\CoreBundle\Entity\Entry; 10use Wallabag\CoreBundle\Entity\Entry;
10use Pagerfanta\Adapter\DoctrineORMAdapter; 11use Wallabag\UserBundle\Entity\User;
11use Pagerfanta\Pagerfanta;
12 12
13class RssController extends Controller 13class RssController extends Controller
14{ 14{
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 64d53f0c..ff4d64a8 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller;
5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Wallabag\CoreBundle\Form\Type\NewTagType;
9use Wallabag\CoreBundle\Entity\Tag;
10use Wallabag\CoreBundle\Entity\Entry; 8use Wallabag\CoreBundle\Entity\Entry;
9use Wallabag\CoreBundle\Entity\Tag;
10use Wallabag\CoreBundle\Form\Type\NewTagType;
11 11
12class TagController extends Controller 12class TagController extends Controller
13{ 13{
@@ -21,7 +21,7 @@ class TagController extends Controller
21 public function addTagFormAction(Request $request, Entry $entry) 21 public function addTagFormAction(Request $request, Entry $entry)
22 { 22 {
23 $tag = new Tag(); 23 $tag = new Tag();
24 $form = $this->createForm(new NewTagType(), $tag); 24 $form = $this->createForm(NewTagType::class, $tag);
25 $form->handleRequest($request); 25 $form->handleRequest($request);
26 26
27 if ($form->isValid()) { 27 if ($form->isValid()) {