aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php7
-rw-r--r--src/Wallabag/ApiBundle/Entity/AccessToken.php2
-rw-r--r--src/Wallabag/ApiBundle/Entity/AuthCode.php2
-rw-r--r--src/Wallabag/ApiBundle/Entity/Client.php2
-rw-r--r--src/Wallabag/ApiBundle/Entity/RefreshToken.php2
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php10
-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
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php4
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php2
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php4
-rw-r--r--src/Wallabag/CoreBundle/Entity/TaggingRule.php2
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php2
-rw-r--r--src/Wallabag/CoreBundle/EventListener/LocaleListener.php2
-rw-r--r--src/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListener.php4
-rw-r--r--src/Wallabag/CoreBundle/Filter/EntryFilterType.php48
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php13
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ConfigType.php13
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EditEntryType.php11
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewEntryType.php8
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewTagType.php8
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewUserType.php17
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/RssType.php5
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php10
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/UserInformationType.php16
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php6
-rw-r--r--src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php2
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml40
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php12
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php6
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php6
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php6
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php4
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php5
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php2
-rw-r--r--src/Wallabag/ImportBundle/Form/Type/UploadImportType.php8
-rw-r--r--src/Wallabag/UserBundle/Controller/ResettingController.php6
-rw-r--r--src/Wallabag/UserBundle/Entity/User.php6
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/baggy/Registration/register.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/ChangePassword/changePassword_content.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/passwordAlreadyRequested.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/reset_content.html.twig2
50 files changed, 202 insertions, 170 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 354a6f8e..d9035cac 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -3,13 +3,14 @@
3namespace Wallabag\ApiBundle\Controller; 3namespace Wallabag\ApiBundle\Controller;
4 4
5use FOS\RestBundle\Controller\FOSRestController; 5use FOS\RestBundle\Controller\FOSRestController;
6use Hateoas\Configuration\Route;
7use Hateoas\Representation\Factory\PagerfantaFactory;
6use Nelmio\ApiDocBundle\Annotation\ApiDoc; 8use Nelmio\ApiDocBundle\Annotation\ApiDoc;
7use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
11use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
9use Wallabag\CoreBundle\Entity\Entry; 12use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag; 13use Wallabag\CoreBundle\Entity\Tag;
11use Hateoas\Configuration\Route;
12use Hateoas\Representation\Factory\PagerfantaFactory;
13 14
14class WallabagRestController extends FOSRestController 15class WallabagRestController extends FOSRestController
15{ 16{
@@ -84,7 +85,7 @@ class WallabagRestController extends FOSRestController
84 $pagerfantaFactory = new PagerfantaFactory('page', 'perPage'); 85 $pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
85 $paginatedCollection = $pagerfantaFactory->createRepresentation( 86 $paginatedCollection = $pagerfantaFactory->createRepresentation(
86 $pager, 87 $pager,
87 new Route('api_get_entries', [], $absolute = true) 88 new Route('api_get_entries', [], UrlGeneratorInterface::ABSOLUTE_URL)
88 ); 89 );
89 90
90 $json = $this->get('serializer')->serialize($paginatedCollection, 'json'); 91 $json = $this->get('serializer')->serialize($paginatedCollection, 'json');
diff --git a/src/Wallabag/ApiBundle/Entity/AccessToken.php b/src/Wallabag/ApiBundle/Entity/AccessToken.php
index b1f4e7de..2ff63a83 100644
--- a/src/Wallabag/ApiBundle/Entity/AccessToken.php
+++ b/src/Wallabag/ApiBundle/Entity/AccessToken.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ApiBundle\Entity; 3namespace Wallabag\ApiBundle\Entity;
4 4
5use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
6use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
7 7
8/** 8/**
9 * @ORM\Table("oauth2_access_tokens") 9 * @ORM\Table("oauth2_access_tokens")
diff --git a/src/Wallabag/ApiBundle/Entity/AuthCode.php b/src/Wallabag/ApiBundle/Entity/AuthCode.php
index 81398158..4d4b09fe 100644
--- a/src/Wallabag/ApiBundle/Entity/AuthCode.php
+++ b/src/Wallabag/ApiBundle/Entity/AuthCode.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ApiBundle\Entity; 3namespace Wallabag\ApiBundle\Entity;
4 4
5use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode;
6use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode;
7 7
8/** 8/**
9 * @ORM\Table("oauth2_auth_codes") 9 * @ORM\Table("oauth2_auth_codes")
diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php
index d449870a..c04ed0f6 100644
--- a/src/Wallabag/ApiBundle/Entity/Client.php
+++ b/src/Wallabag/ApiBundle/Entity/Client.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ApiBundle\Entity; 3namespace Wallabag\ApiBundle\Entity;
4 4
5use FOS\OAuthServerBundle\Entity\Client as BaseClient;
6use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use FOS\OAuthServerBundle\Entity\Client as BaseClient;
7 7
8/** 8/**
9 * @ORM\Table("oauth2_clients") 9 * @ORM\Table("oauth2_clients")
diff --git a/src/Wallabag/ApiBundle/Entity/RefreshToken.php b/src/Wallabag/ApiBundle/Entity/RefreshToken.php
index be2c1d2e..6d0cab68 100644
--- a/src/Wallabag/ApiBundle/Entity/RefreshToken.php
+++ b/src/Wallabag/ApiBundle/Entity/RefreshToken.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\ApiBundle\Entity; 3namespace Wallabag\ApiBundle\Entity;
4 4
5use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken;
6use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken;
7 7
8/** 8/**
9 * @ORM\Table("oauth2_refresh_tokens") 9 * @ORM\Table("oauth2_refresh_tokens")
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index e791d4dd..da099a19 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -3,14 +3,14 @@
3namespace Wallabag\CoreBundle\Command; 3namespace Wallabag\CoreBundle\Command;
4 4
5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6use Symfony\Component\Console\Helper\Table;
7use Symfony\Component\Console\Input\ArrayInput;
6use Symfony\Component\Console\Input\InputInterface; 8use Symfony\Component\Console\Input\InputInterface;
7use Symfony\Component\Console\Input\InputOption; 9use Symfony\Component\Console\Input\InputOption;
8use Symfony\Component\Console\Input\ArrayInput;
9use Symfony\Component\Console\Output\OutputInterface;
10use Symfony\Component\Console\Output\NullOutput; 10use Symfony\Component\Console\Output\NullOutput;
11use Symfony\Component\Console\Question\Question; 11use Symfony\Component\Console\Output\OutputInterface;
12use Symfony\Component\Console\Question\ConfirmationQuestion; 12use Symfony\Component\Console\Question\ConfirmationQuestion;
13use Symfony\Component\Console\Helper\Table; 13use Symfony\Component\Console\Question\Question;
14use Wallabag\CoreBundle\Entity\Config; 14use Wallabag\CoreBundle\Entity\Config;
15 15
16class InstallCommand extends ContainerAwareCommand 16class InstallCommand extends ContainerAwareCommand
@@ -55,7 +55,7 @@ class InstallCommand extends ContainerAwareCommand
55 ; 55 ;
56 56
57 $output->writeln('<info>Wallabag has been successfully installed.</info>'); 57 $output->writeln('<info>Wallabag has been successfully installed.</info>');
58 $output->writeln('<comment>Just execute `php app/console server:run` for using wallabag: http://localhost:8000</comment>'); 58 $output->writeln('<comment>Just execute `php bin/console server:run` for using wallabag: http://localhost:8000</comment>');
59 } 59 }
60 60
61 protected function checkRequirements() 61 protected function checkRequirements()
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 3d22c7bc..aa70307b 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
@@ -117,7 +117,7 @@ class EntryController extends Controller
117 { 117 {
118 $this->checkUserAction($entry); 118 $this->checkUserAction($entry);
119 119
120 $form = $this->createForm(new EditEntryType(), $entry); 120 $form = $this->createForm(EditEntryType::class, $entry);
121 121
122 $form->handleRequest($request); 122 $form->handleRequest($request);
123 123
@@ -239,7 +239,7 @@ class EntryController extends Controller
239 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); 239 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
240 } 240 }
241 241
242 $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser())); 242 $form = $this->createForm(EntryFilterType::class);
243 243
244 if ($request->query->has($form->getName())) { 244 if ($request->query->has($form->getName())) {
245 // manually bind values from the request 245 // 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()) {
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 330cc957..9ff9b732 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -2,10 +2,10 @@
2 2
3namespace Wallabag\CoreBundle\DependencyInjection; 3namespace Wallabag\CoreBundle\DependencyInjection;
4 4
5use Symfony\Component\DependencyInjection\ContainerBuilder;
6use Symfony\Component\Config\FileLocator; 5use Symfony\Component\Config\FileLocator;
7use Symfony\Component\HttpKernel\DependencyInjection\Extension; 6use Symfony\Component\DependencyInjection\ContainerBuilder;
8use Symfony\Component\DependencyInjection\Loader; 7use Symfony\Component\DependencyInjection\Loader;
8use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9 9
10class WallabagCoreExtension extends Extension 10class WallabagCoreExtension extends Extension
11{ 11{
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index f11a7786..24b24dbb 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -4,10 +4,10 @@ namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\Common\Collections\ArrayCollection; 5use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
7use Symfony\Component\Validator\Constraints as Assert;
8use Hateoas\Configuration\Annotation as Hateoas; 7use Hateoas\Configuration\Annotation as Hateoas;
9use JMS\Serializer\Annotation\Groups; 8use JMS\Serializer\Annotation\Groups;
10use JMS\Serializer\Annotation\XmlRoot; 9use JMS\Serializer\Annotation\XmlRoot;
10use Symfony\Component\Validator\Constraints as Assert;
11use Wallabag\UserBundle\Entity\User; 11use Wallabag\UserBundle\Entity\User;
12 12
13/** 13/**
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php
index 0689c7b3..c1940e99 100644
--- a/src/Wallabag/CoreBundle/Entity/Tag.php
+++ b/src/Wallabag/CoreBundle/Entity/Tag.php
@@ -2,12 +2,12 @@
2 2
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\Common\Collections\ArrayCollection;
5use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
6use JMS\Serializer\Annotation\XmlRoot;
7use JMS\Serializer\Annotation\ExclusionPolicy; 7use JMS\Serializer\Annotation\ExclusionPolicy;
8use JMS\Serializer\Annotation\Expose; 8use JMS\Serializer\Annotation\Expose;
9use Doctrine\Common\Collections\ArrayCollection;
10use Gedmo\Mapping\Annotation as Gedmo; 9use Gedmo\Mapping\Annotation as Gedmo;
10use JMS\Serializer\Annotation\XmlRoot;
11 11
12/** 12/**
13 * Tag. 13 * Tag.
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
index 329d7ff8..28914cc1 100644
--- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php
+++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
@@ -3,8 +3,8 @@
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert;
7use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; 6use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert;
7use Symfony\Component\Validator\Constraints as Assert;
8 8
9/** 9/**
10 * Tagging rule. 10 * Tagging rule.
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
index cfdbfe97..cabb3eca 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\CoreBundle\Event\Subscriber; 3namespace Wallabag\CoreBundle\Event\Subscriber;
4 4
5use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
6use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent; 5use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
6use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
7use Symfony\Component\EventDispatcher\EventSubscriberInterface; 7use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8 8
9/** 9/**
diff --git a/src/Wallabag/CoreBundle/EventListener/LocaleListener.php b/src/Wallabag/CoreBundle/EventListener/LocaleListener.php
index 80f59504..05deac0a 100644
--- a/src/Wallabag/CoreBundle/EventListener/LocaleListener.php
+++ b/src/Wallabag/CoreBundle/EventListener/LocaleListener.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\CoreBundle\EventListener; 3namespace Wallabag\CoreBundle\EventListener;
4 4
5use Symfony\Component\EventDispatcher\EventSubscriberInterface;
5use Symfony\Component\HttpKernel\Event\GetResponseEvent; 6use Symfony\Component\HttpKernel\Event\GetResponseEvent;
6use Symfony\Component\HttpKernel\KernelEvents; 7use Symfony\Component\HttpKernel\KernelEvents;
7use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8 8
9/** 9/**
10 * @see http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html 10 * @see http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html
diff --git a/src/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListener.php b/src/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListener.php
index 68c25f1f..1c9160d5 100644
--- a/src/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListener.php
+++ b/src/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListener.php
@@ -2,11 +2,11 @@
2 2
3namespace Wallabag\CoreBundle\EventListener; 3namespace Wallabag\CoreBundle\EventListener;
4 4
5use Symfony\Component\EventDispatcher\EventDispatcherInterface;
6use Symfony\Component\EventDispatcher\EventSubscriberInterface;
7use Doctrine\ORM\EntityManager; 5use Doctrine\ORM\EntityManager;
8use FOS\UserBundle\Event\FilterUserResponseEvent; 6use FOS\UserBundle\Event\FilterUserResponseEvent;
9use FOS\UserBundle\FOSUserEvents; 7use FOS\UserBundle\FOSUserEvents;
8use Symfony\Component\EventDispatcher\EventDispatcherInterface;
9use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
11 11
12class RegistrationConfirmedListener implements EventSubscriberInterface 12class RegistrationConfirmedListener implements EventSubscriberInterface
diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
index 32de21ca..c38be832 100644
--- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
@@ -2,12 +2,17 @@
2 2
3namespace Wallabag\CoreBundle\Filter; 3namespace Wallabag\CoreBundle\Filter;
4 4
5use Doctrine\ORM\EntityRepository;
6use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
7use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
8use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
9use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
10use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
11use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
5use Symfony\Component\Form\AbstractType; 12use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\FormBuilderInterface; 13use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 14use Symfony\Component\OptionsResolver\OptionsResolver;
8use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; 15use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
9use Doctrine\ORM\EntityRepository;
10use Wallabag\UserBundle\Entity\User;
11 16
12class EntryFilterType extends AbstractType 17class EntryFilterType extends AbstractType
13{ 18{
@@ -18,19 +23,19 @@ class EntryFilterType extends AbstractType
18 * Repository & user are used to get a list of language entries for this user. 23 * Repository & user are used to get a list of language entries for this user.
19 * 24 *
20 * @param EntityRepository $entryRepository 25 * @param EntityRepository $entryRepository
21 * @param User $user 26 * @param TokenStorage $token
22 */ 27 */
23 public function __construct(EntityRepository $entryRepository, User $user) 28 public function __construct(EntityRepository $entryRepository, TokenStorage $token)
24 { 29 {
25 $this->repository = $entryRepository; 30 $this->repository = $entryRepository;
26 $this->user = $user; 31 $this->user = $token->getToken()->getUser();
27 } 32 }
28 33
29 public function buildForm(FormBuilderInterface $builder, array $options) 34 public function buildForm(FormBuilderInterface $builder, array $options)
30 { 35 {
31 $builder 36 $builder
32 ->add('readingTime', 'filter_number_range') 37 ->add('readingTime', NumberRangeFilterType::class)
33 ->add('createdAt', 'filter_date_range', array( 38 ->add('createdAt', DateRangeFilterType::class, array(
34 'left_date_options' => array( 39 'left_date_options' => array(
35 'attr' => array( 40 'attr' => array(
36 'placeholder' => 'dd/mm/yyyy', 41 'placeholder' => 'dd/mm/yyyy',
@@ -47,20 +52,20 @@ class EntryFilterType extends AbstractType
47 ), 52 ),
48 ) 53 )
49 ) 54 )
50 ->add('domainName', 'filter_text', array( 55 ->add('domainName', TextFilterType::class, array(
51 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 56 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
52 $value = $values['value']; 57 $value = $values['value'];
53 if (strlen($value) <= 2 || empty($value)) { 58 if (strlen($value) <= 2 || empty($value)) {
54 return; 59 return;
55 } 60 }
56 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); 61 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
57 62
58 return $filterQuery->createCondition($expression); 63 return $filterQuery->createCondition($expression);
59 }, 64 },
60 )) 65 ))
61 ->add('isArchived', 'filter_checkbox') 66 ->add('isArchived', CheckboxFilterType::class)
62 ->add('isStarred', 'filter_checkbox') 67 ->add('isStarred', CheckboxFilterType::class)
63 ->add('previewPicture', 'filter_checkbox', array( 68 ->add('previewPicture', CheckboxFilterType::class, array(
64 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 69 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
65 if (false === $values['value']) { 70 if (false === $values['value']) {
66 return; 71 return;
@@ -71,13 +76,14 @@ class EntryFilterType extends AbstractType
71 return $filterQuery->createCondition($expression); 76 return $filterQuery->createCondition($expression);
72 }, 77 },
73 )) 78 ))
74 ->add('language', 'filter_choice', array( 79 ->add('language', ChoiceFilterType::class, array(
75 'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()), 80 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
81 'choices_as_values' => true,
76 )) 82 ))
77 ; 83 ;
78 } 84 }
79 85
80 public function getName() 86 public function getBlockPrefix()
81 { 87 {
82 return 'entry_filter'; 88 return 'entry_filter';
83 } 89 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
index 82e1954d..7d05a5d8 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
@@ -3,6 +3,9 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\PasswordType;
7use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 9use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; 10use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
8use Symfony\Component\Validator\Constraints; 11use Symfony\Component\Validator\Constraints;
@@ -12,11 +15,11 @@ class ChangePasswordType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 15 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 16 {
14 $builder 17 $builder
15 ->add('old_password', 'password', array( 18 ->add('old_password', PasswordType::class, array(
16 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), 19 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
17 )) 20 ))
18 ->add('new_password', 'repeated', array( 21 ->add('new_password', RepeatedType::class, array(
19 'type' => 'password', 22 'type' => PasswordType::class,
20 'invalid_message' => 'The password fields must match.', 23 'invalid_message' => 'The password fields must match.',
21 'required' => true, 24 'required' => true,
22 'first_options' => array('label' => 'New password'), 25 'first_options' => array('label' => 'New password'),
@@ -29,11 +32,11 @@ class ChangePasswordType extends AbstractType
29 new Constraints\NotBlank(), 32 new Constraints\NotBlank(),
30 ), 33 ),
31 )) 34 ))
32 ->add('save', 'submit') 35 ->add('save', SubmitType::class)
33 ; 36 ;
34 } 37 }
35 38
36 public function getName() 39 public function getBlockPrefix()
37 { 40 {
38 return 'change_passwd'; 41 return 'change_passwd';
39 } 42 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index 1f0ad89d..a139f2df 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -28,15 +30,16 @@ class ConfigType extends AbstractType
28 public function buildForm(FormBuilderInterface $builder, array $options) 30 public function buildForm(FormBuilderInterface $builder, array $options)
29 { 31 {
30 $builder 32 $builder
31 ->add('theme', 'choice', array( 33 ->add('theme', ChoiceType::class, array(
32 'choices' => array_flip($this->themes), 34 'choices' => array_flip($this->themes),
33 'choices_as_values' => true, 35 'choices_as_values' => true,
34 )) 36 ))
35 ->add('items_per_page') 37 ->add('items_per_page')
36 ->add('language', 'choice', array( 38 ->add('language', ChoiceType::class, array(
37 'choices' => $this->languages, 39 'choices' => array_flip($this->languages),
40 'choices_as_values' => true,
38 )) 41 ))
39 ->add('save', 'submit') 42 ->add('save', SubmitType::class)
40 ; 43 ;
41 } 44 }
42 45
@@ -47,7 +50,7 @@ class ConfigType extends AbstractType
47 )); 50 ));
48 } 51 }
49 52
50 public function getName() 53 public function getBlockPrefix()
51 { 54 {
52 return 'config'; 55 return 'config';
53 } 56 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
index 0fa4b71f..0cb29881 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
@@ -3,6 +3,9 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 9use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 10use Symfony\Component\OptionsResolver\OptionsResolver;
8 11
@@ -11,14 +14,14 @@ class EditEntryType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 14 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 15 {
13 $builder 16 $builder
14 ->add('title', 'text', array('required' => true)) 17 ->add('title', TextType::class, array('required' => true))
15 ->add('is_public', 'checkbox', array('required' => false)) 18 ->add('is_public', CheckboxType::class, array('required' => false))
16 // @todo: add autocomplete 19 // @todo: add autocomplete
17 // ->add('tags', 'entity', array( 20 // ->add('tags', 'entity', array(
18 // 'class' => 'Wallabag\CoreBundle\Entity\Tag', 21 // 'class' => 'Wallabag\CoreBundle\Entity\Tag',
19 // 'choice_translation_domain' => true, 22 // 'choice_translation_domain' => true,
20 // )) 23 // ))
21 ->add('save', 'submit') 24 ->add('save', SubmitType::class)
22 ; 25 ;
23 } 26 }
24 27
@@ -29,7 +32,7 @@ class EditEntryType extends AbstractType
29 )); 32 ));
30 } 33 }
31 34
32 public function getName() 35 public function getBlockPrefix()
33 { 36 {
34 return 'entry'; 37 return 'entry';
35 } 38 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
index cb96d11a..fbce13f1 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\UrlType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -11,8 +13,8 @@ class NewEntryType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 13 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 14 {
13 $builder 15 $builder
14 ->add('url', 'url', array('required' => true)) 16 ->add('url', UrlType::class, array('required' => true))
15 ->add('save', 'submit') 17 ->add('save', SubmitType::class)
16 ; 18 ;
17 } 19 }
18 20
@@ -23,7 +25,7 @@ class NewEntryType extends AbstractType
23 )); 25 ));
24 } 26 }
25 27
26 public function getName() 28 public function getBlockPrefix()
27 { 29 {
28 return 'entry'; 30 return 'entry';
29 } 31 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
index 8e4ab649..0f559031 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8 10
@@ -11,8 +13,8 @@ class NewTagType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 13 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 14 {
13 $builder 15 $builder
14 ->add('label', 'text', array('required' => true)) 16 ->add('label', TextType::class, array('required' => true))
15 ->add('save', 'submit') 17 ->add('save', SubmitType::class)
16 ; 18 ;
17 } 19 }
18 20
@@ -23,7 +25,7 @@ class NewTagType extends AbstractType
23 )); 25 ));
24 } 26 }
25 27
26 public function getName() 28 public function getBlockPrefix()
27 { 29 {
28 return 'tag'; 30 return 'tag';
29 } 31 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
index 8aabc8bb..ffbe9ba2 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
@@ -3,6 +3,11 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\EmailType;
7use Symfony\Component\Form\Extension\Core\Type\PasswordType;
8use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
9use Symfony\Component\Form\Extension\Core\Type\SubmitType;
10use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 11use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 12use Symfony\Component\OptionsResolver\OptionsResolver;
8use Symfony\Component\Validator\Constraints; 13use Symfony\Component\Validator\Constraints;
@@ -12,9 +17,9 @@ class NewUserType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 17 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 18 {
14 $builder 19 $builder
15 ->add('username', 'text', array('required' => true)) 20 ->add('username', TextType::class, array('required' => true))
16 ->add('plainPassword', 'repeated', array( 21 ->add('plainPassword', RepeatedType::class, array(
17 'type' => 'password', 22 'type' => PasswordType::class,
18 'constraints' => array( 23 'constraints' => array(
19 new Constraints\Length(array( 24 new Constraints\Length(array(
20 'min' => 8, 25 'min' => 8,
@@ -23,8 +28,8 @@ class NewUserType extends AbstractType
23 new Constraints\NotBlank(), 28 new Constraints\NotBlank(),
24 ), 29 ),
25 )) 30 ))
26 ->add('email', 'email') 31 ->add('email', EmailType::class)
27 ->add('save', 'submit') 32 ->add('save', SubmitType::class)
28 ; 33 ;
29 } 34 }
30 35
@@ -35,7 +40,7 @@ class NewUserType extends AbstractType
35 )); 40 ));
36 } 41 }
37 42
38 public function getName() 43 public function getBlockPrefix()
39 { 44 {
40 return 'new_user'; 45 return 'new_user';
41 } 46 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/RssType.php b/src/Wallabag/CoreBundle/Form/Type/RssType.php
index 1f7f4c68..def8782c 100644
--- a/src/Wallabag/CoreBundle/Form/Type/RssType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/RssType.php
@@ -3,6 +3,7 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
6use Symfony\Component\Form\FormBuilderInterface; 7use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 8use Symfony\Component\OptionsResolver\OptionsResolver;
8 9
@@ -12,7 +13,7 @@ class RssType extends AbstractType
12 { 13 {
13 $builder 14 $builder
14 ->add('rss_limit') 15 ->add('rss_limit')
15 ->add('save', 'submit') 16 ->add('save', SubmitType::class)
16 ; 17 ;
17 } 18 }
18 19
@@ -23,7 +24,7 @@ class RssType extends AbstractType
23 )); 24 ));
24 } 25 }
25 26
26 public function getName() 27 public function getBlockPrefix()
27 { 28 {
28 return 'rss_config'; 29 return 'rss_config';
29 } 30 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
index 428d94b3..5815b8c6 100644
--- a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php
@@ -3,6 +3,8 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 9use Symfony\Component\OptionsResolver\OptionsResolver;
8use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer; 10use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer;
@@ -12,12 +14,12 @@ class TaggingRuleType extends AbstractType
12 public function buildForm(FormBuilderInterface $builder, array $options) 14 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 15 {
14 $builder 16 $builder
15 ->add('rule', 'text', array('required' => true)) 17 ->add('rule', TextType::class, array('required' => true))
16 ->add('save', 'submit') 18 ->add('save', SubmitType::class)
17 ; 19 ;
18 20
19 $tagsField = $builder 21 $tagsField = $builder
20 ->create('tags', 'text') 22 ->create('tags', TextType::class)
21 ->addModelTransformer(new StringToListTransformer(',')); 23 ->addModelTransformer(new StringToListTransformer(','));
22 24
23 $builder->add($tagsField); 25 $builder->add($tagsField);
@@ -30,7 +32,7 @@ class TaggingRuleType extends AbstractType
30 )); 32 ));
31 } 33 }
32 34
33 public function getName() 35 public function getBlockPrefix()
34 { 36 {
35 return 'tagging_rule'; 37 return 'tagging_rule';
36 } 38 }
diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
index e06c937d..f491b0ae 100644
--- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
@@ -3,6 +3,10 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\EmailType;
8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
9use Symfony\Component\Form\Extension\Core\Type\TextType;
6use Symfony\Component\Form\FormBuilderInterface; 10use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 11use Symfony\Component\OptionsResolver\OptionsResolver;
8 12
@@ -11,10 +15,10 @@ class UserInformationType extends AbstractType
11 public function buildForm(FormBuilderInterface $builder, array $options) 15 public function buildForm(FormBuilderInterface $builder, array $options)
12 { 16 {
13 $builder 17 $builder
14 ->add('name', 'text') 18 ->add('name', TextType::class)
15 ->add('email', 'email') 19 ->add('email', EmailType::class)
16 ->add('twoFactorAuthentication', 'checkbox', array('required' => false)) 20 ->add('twoFactorAuthentication', CheckboxType::class, array('required' => false))
17 ->add('save', 'submit') 21 ->add('save', SubmitType::class)
18 ->remove('username') 22 ->remove('username')
19 ->remove('plainPassword') 23 ->remove('plainPassword')
20 ; 24 ;
@@ -22,7 +26,7 @@ class UserInformationType extends AbstractType
22 26
23 public function getParent() 27 public function getParent()
24 { 28 {
25 return 'fos_user_registration'; 29 return 'FOS\UserBundle\Form\Type\RegistrationFormType';
26 } 30 }
27 31
28 public function configureOptions(OptionsResolver $resolver) 32 public function configureOptions(OptionsResolver $resolver)
@@ -32,7 +36,7 @@ class UserInformationType extends AbstractType
32 )); 36 ));
33 } 37 }
34 38
35 public function getName() 39 public function getBlockPrefix()
36 { 40 {
37 return 'update_user'; 41 return 'update_user';
38 } 42 }
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index d6a4d094..31a80d6e 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -2,12 +2,12 @@
2 2
3namespace Wallabag\CoreBundle\Helper; 3namespace Wallabag\CoreBundle\Helper;
4 4
5use JMS\Serializer;
6use JMS\Serializer\SerializationContext;
7use JMS\Serializer\SerializerBuilder;
5use PHPePub\Core\EPub; 8use PHPePub\Core\EPub;
6use PHPePub\Core\Structure\OPF\DublinCore; 9use PHPePub\Core\Structure\OPF\DublinCore;
7use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
8use JMS\Serializer;
9use JMS\Serializer\SerializerBuilder;
10use JMS\Serializer\SerializationContext;
11 11
12/** 12/**
13 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest. 13 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
diff --git a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php b/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php
index f7faa2c1..6ea2a4f3 100644
--- a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php
+++ b/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\CoreBundle\ParamConverter; 3namespace Wallabag\CoreBundle\ParamConverter;
4 4
5use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
6use Doctrine\Common\Persistence\ManagerRegistry; 5use Doctrine\Common\Persistence\ManagerRegistry;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 6use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
7use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
8use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
9use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 9use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
10use Wallabag\UserBundle\Entity\User; 10use Wallabag\UserBundle\Entity\User;
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 96b1c931..43600735 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -2,7 +2,7 @@ services:
2 wallabag_core.helper.detect_active_theme: 2 wallabag_core.helper.detect_active_theme:
3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme 3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme
4 arguments: 4 arguments:
5 - @security.token_storage 5 - "@security.token_storage"
6 - %theme% # default theme from parameters.yml 6 - %theme% # default theme from parameters.yml
7 7
8 # custom form type 8 # custom form type
@@ -12,26 +12,22 @@ services:
12 - %liip_theme.themes% 12 - %liip_theme.themes%
13 - %wallabag_core.languages% 13 - %wallabag_core.languages%
14 tags: 14 tags:
15 - { name: form.type, alias: config } 15 - { name: form.type }
16 16
17 wallabag_core.form.registration: 17 wallabag_core.filter.type.entry:
18 class: Wallabag\CoreBundle\Form\Type\RegistrationType 18 class: Wallabag\CoreBundle\Filter\EntryFilterType
19 tags:
20 - { name: form.type, alias: wallabag_user_registration }
21
22 wallabag_core.form.type.forgot_password:
23 class: Wallabag\CoreBundle\Form\Type\ForgotPasswordType
24 arguments: 19 arguments:
25 - @doctrine 20 - "@wallabag_core.entry_repository"
21 - "@security.token_storage"
26 tags: 22 tags:
27 - { name: form.type, alias: forgot_password } 23 - { name: form.type }
28 24
29 wallabag_core.param_converter.username_rsstoken_converter: 25 wallabag_core.param_converter.username_rsstoken_converter:
30 class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter 26 class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter
31 tags: 27 tags:
32 - { name: request.param_converter, converter: username_rsstoken_converter } 28 - { name: request.param_converter, converter: username_rsstoken_converter }
33 arguments: 29 arguments:
34 - @doctrine 30 - "@doctrine"
35 31
36 wallabag_core.table_prefix_subscriber: 32 wallabag_core.table_prefix_subscriber:
37 class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber 33 class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
@@ -45,41 +41,41 @@ services:
45 arguments: 41 arguments:
46 - { error_message: false } 42 - { error_message: false }
47 calls: 43 calls:
48 - [ setLogger, [ @logger ] ] 44 - [ setLogger, [ "@logger" ] ]
49 tags: 45 tags:
50 - { name: monolog.logger, channel: graby } 46 - { name: monolog.logger, channel: graby }
51 47
52 wallabag_core.content_proxy: 48 wallabag_core.content_proxy:
53 class: Wallabag\CoreBundle\Helper\ContentProxy 49 class: Wallabag\CoreBundle\Helper\ContentProxy
54 arguments: 50 arguments:
55 - @wallabag_core.graby 51 - "@wallabag_core.graby"
56 - @wallabag_core.rule_based_tagger 52 - "@wallabag_core.rule_based_tagger"
57 - @logger 53 - "@logger"
58 54
59 wallabag_core.rule_based_tagger: 55 wallabag_core.rule_based_tagger:
60 class: Wallabag\CoreBundle\Helper\RuleBasedTagger 56 class: Wallabag\CoreBundle\Helper\RuleBasedTagger
61 arguments: 57 arguments:
62 - @rulerz 58 - "@rulerz"
63 - @wallabag_core.tag_repository 59 - "@wallabag_core.tag_repository"
64 - @wallabag_core.entry_repository 60 - "@wallabag_core.entry_repository"
65 61
66 # repository as a service 62 # repository as a service
67 wallabag_core.entry_repository: 63 wallabag_core.entry_repository:
68 class: Wallabag\CoreBundle\Repository\EntryRepository 64 class: Wallabag\CoreBundle\Repository\EntryRepository
69 factory: [ @doctrine.orm.default_entity_manager, getRepository ] 65 factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
70 arguments: 66 arguments:
71 - WallabagCoreBundle:Entry 67 - WallabagCoreBundle:Entry
72 68
73 wallabag_core.tag_repository: 69 wallabag_core.tag_repository:
74 class: Wallabag\CoreBundle\Repository\TagRepository 70 class: Wallabag\CoreBundle\Repository\TagRepository
75 factory: [ @doctrine.orm.default_entity_manager, getRepository ] 71 factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
76 arguments: 72 arguments:
77 - WallabagCoreBundle:Tag 73 - WallabagCoreBundle:Tag
78 74
79 wallabag_core.registration_confirmed: 75 wallabag_core.registration_confirmed:
80 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener 76 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener
81 arguments: 77 arguments:
82 - @doctrine.orm.entity_manager 78 - "@doctrine.orm.entity_manager"
83 - %theme% 79 - %theme%
84 - %items_on_page% 80 - %items_on_page%
85 - %rss_limit% 81 - %rss_limit%
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
index d9850f7a..6ac6decb 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
@@ -164,7 +164,7 @@
164 {% endfor %} 164 {% endfor %}
165 </ul> 165 </ul>
166 166
167 <form action="{{ path('config') }}" method="post" {{ form_enctype(form.new_tagging_rule) }}> 167 {{ form_start(form.new_tagging_rule) }}
168 {{ form_errors(form.new_tagging_rule) }} 168 {{ form_errors(form.new_tagging_rule) }}
169 169
170 <fieldset class="w500p inline"> 170 <fieldset class="w500p inline">
diff --git a/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php
index 0019eead..9a4b16ee 100644
--- a/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php
+++ b/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php
@@ -2,8 +2,8 @@
2 2
3namespace Wallabag\CoreBundle\Subscriber; 3namespace Wallabag\CoreBundle\Subscriber;
4 4
5use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
6use Doctrine\Common\EventSubscriber; 5use Doctrine\Common\EventSubscriber;
6use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
7use Doctrine\ORM\Mapping\ClassMetadataInfo; 7use Doctrine\ORM\Mapping\ClassMetadataInfo;
8 8
9/** 9/**
diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
index c9346040..7d75e2b7 100644
--- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
@@ -2,15 +2,15 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Command; 3namespace Wallabag\CoreBundle\Tests\Command;
4 4
5use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; 5use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
6use Wallabag\CoreBundle\Command\InstallCommand; 6use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand;
7use Wallabag\CoreBundle\Tests\Mock\InstallCommandMock;
8use Symfony\Bundle\FrameworkBundle\Console\Application; 7use Symfony\Bundle\FrameworkBundle\Console\Application;
9use Symfony\Component\Console\Tester\CommandTester;
10use Symfony\Component\Console\Input\ArrayInput; 8use Symfony\Component\Console\Input\ArrayInput;
11use Symfony\Component\Console\Output\NullOutput; 9use Symfony\Component\Console\Output\NullOutput;
12use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; 10use Symfony\Component\Console\Tester\CommandTester;
13use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; 11use Wallabag\CoreBundle\Command\InstallCommand;
12use Wallabag\CoreBundle\Tests\Mock\InstallCommandMock;
13use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
14 14
15class InstallCommandTest extends WallabagCoreTestCase 15class InstallCommandTest extends WallabagCoreTestCase
16{ 16{
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
index d89bee04..b4c022d5 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
@@ -4,11 +4,11 @@ namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use Symfony\Component\EventDispatcher\EventDispatcher; 5use Symfony\Component\EventDispatcher\EventDispatcher;
6use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\HttpKernel\KernelEvents; 7use Symfony\Component\HttpFoundation\Session\Session;
8use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
8use Symfony\Component\HttpKernel\Event\GetResponseEvent; 9use Symfony\Component\HttpKernel\Event\GetResponseEvent;
9use Symfony\Component\HttpKernel\HttpKernelInterface; 10use Symfony\Component\HttpKernel\HttpKernelInterface;
10use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; 11use Symfony\Component\HttpKernel\KernelEvents;
11use Symfony\Component\HttpFoundation\Session\Session;
12use Wallabag\CoreBundle\EventListener\LocaleListener; 12use Wallabag\CoreBundle\EventListener\LocaleListener;
13 13
14class LocaleListenerTest extends \PHPUnit_Framework_TestCase 14class LocaleListenerTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
index 31283399..7039dc61 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
@@ -2,13 +2,13 @@
2 2
3namespace Wallabag\CoreBundle\Tests\EventListener; 3namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use FOS\UserBundle\Event\FilterUserResponseEvent;
6use FOS\UserBundle\FOSUserEvents;
5use Symfony\Component\EventDispatcher\EventDispatcher; 7use Symfony\Component\EventDispatcher\EventDispatcher;
6use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\HttpFoundation\Response; 9use Symfony\Component\HttpFoundation\Response;
8use FOS\UserBundle\FOSUserEvents;
9use FOS\UserBundle\Event\FilterUserResponseEvent;
10use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener;
11use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
11use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener;
12use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
13 13
14class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase 14class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
index 80ddb457..d9ffe30e 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
@@ -3,12 +3,12 @@
3namespace Wallabag\CoreBundle\Tests\EventListener; 3namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
7use Symfony\Component\HttpFoundation\Session\Session; 6use Symfony\Component\HttpFoundation\Session\Session;
8use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; 7use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
9use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; 8use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
10use Wallabag\CoreBundle\EventListener\UserLocaleListener; 9use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
11use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
11use Wallabag\CoreBundle\EventListener\UserLocaleListener;
12use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
13 13
14class UserLocaleListenerTest extends \PHPUnit_Framework_TestCase 14class UserLocaleListenerTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
index ac518dbb..d29984e9 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
@@ -4,8 +4,8 @@ namespace Wallabag\CoreBundle\Tests\Helper;
4 4
5use Psr\Log\NullLogger; 5use Psr\Log\NullLogger;
6use Wallabag\CoreBundle\Entity\Entry; 6use Wallabag\CoreBundle\Entity\Entry;
7use Wallabag\UserBundle\Entity\User;
8use Wallabag\CoreBundle\Helper\ContentProxy; 7use Wallabag\CoreBundle\Helper\ContentProxy;
8use Wallabag\UserBundle\Entity\User;
9 9
10class ContentProxyTest extends \PHPUnit_Framework_TestCase 10class ContentProxyTest extends \PHPUnit_Framework_TestCase
11{ 11{
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
index dee17d65..c43c62c3 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
@@ -6,8 +6,8 @@ use Wallabag\CoreBundle\Entity\Config;
6use Wallabag\CoreBundle\Entity\Entry; 6use Wallabag\CoreBundle\Entity\Entry;
7use Wallabag\CoreBundle\Entity\Tag; 7use Wallabag\CoreBundle\Entity\Tag;
8use Wallabag\CoreBundle\Entity\TaggingRule; 8use Wallabag\CoreBundle\Entity\TaggingRule;
9use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Helper\RuleBasedTagger; 9use Wallabag\CoreBundle\Helper\RuleBasedTagger;
10use Wallabag\UserBundle\Entity\User;
11 11
12class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase 12class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
13{ 13{
diff --git a/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php b/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
index 1c9a4ad7..b95be133 100644
--- a/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
+++ b/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Command; 3namespace Wallabag\CoreBundle\Tests\Command;
4 4
5use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 5use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
7use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
8use Wallabag\UserBundle\Entity\User; 8use Wallabag\UserBundle\Entity\User;
9 9
10class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase 10class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php b/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php
index a26ff436..49dbb316 100644
--- a/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php
@@ -2,9 +2,9 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Subscriber; 3namespace Wallabag\CoreBundle\Tests\Subscriber;
4 4
5use Doctrine\ORM\Mapping\ClassMetadata;
6use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
7use Doctrine\Common\EventManager; 5use Doctrine\Common\EventManager;
6use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
7use Doctrine\ORM\Mapping\ClassMetadata;
8use Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber; 8use Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber;
9 9
10class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase 10class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index a0853383..7aee302f 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -3,6 +3,7 @@
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7 8
8class PocketController extends Controller 9class PocketController extends Controller
@@ -23,12 +24,12 @@ class PocketController extends Controller
23 public function authAction() 24 public function authAction()
24 { 25 {
25 $requestToken = $this->get('wallabag_import.pocket.import') 26 $requestToken = $this->get('wallabag_import.pocket.import')
26 ->getRequestToken($this->generateUrl('import', [], true)); 27 ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL));
27 28
28 $this->get('session')->set('import.pocket.code', $requestToken); 29 $this->get('session')->set('import.pocket.code', $requestToken);
29 30
30 return $this->redirect( 31 return $this->redirect(
31 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], true), 32 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL),
32 301 33 301
33 ); 34 );
34 } 35 }
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
index e50a6c35..35fe620f 100644
--- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
+++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
@@ -14,7 +14,7 @@ class WallabagV1Controller extends Controller
14 */ 14 */
15 public function indexAction(Request $request) 15 public function indexAction(Request $request)
16 { 16 {
17 $form = $this->createForm(new UploadImportType()); 17 $form = $this->createForm(UploadImportType::class);
18 $form->handleRequest($request); 18 $form->handleRequest($request);
19 19
20 $wallabag = $this->get('wallabag_import.wallabag_v1.import'); 20 $wallabag = $this->get('wallabag_import.wallabag_v1.import');
diff --git a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
index 415890f3..2e6b59cb 100644
--- a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
+++ b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
@@ -4,18 +4,20 @@ namespace Wallabag\ImportBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\FormBuilderInterface; 6use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\FileType;
7 9
8class UploadImportType extends AbstractType 10class UploadImportType extends AbstractType
9{ 11{
10 public function buildForm(FormBuilderInterface $builder, array $options) 12 public function buildForm(FormBuilderInterface $builder, array $options)
11 { 13 {
12 $builder 14 $builder
13 ->add('file', 'file') 15 ->add('file', FileType::class)
14 ->add('save', 'submit') 16 ->add('save', SubmitType::class)
15 ; 17 ;
16 } 18 }
17 19
18 public function getName() 20 public function getBlockPrefix()
19 { 21 {
20 return 'upload_import_file'; 22 return 'upload_import_file';
21 } 23 }
diff --git a/src/Wallabag/UserBundle/Controller/ResettingController.php b/src/Wallabag/UserBundle/Controller/ResettingController.php
index 8aa1e230..62e27d00 100644
--- a/src/Wallabag/UserBundle/Controller/ResettingController.php
+++ b/src/Wallabag/UserBundle/Controller/ResettingController.php
@@ -2,12 +2,12 @@
2 2
3namespace Wallabag\UserBundle\Controller; 3namespace Wallabag\UserBundle\Controller;
4 4
5use FOS\UserBundle\FOSUserEvents; 5use FOS\UserBundle\Event\FilterUserResponseEvent;
6use FOS\UserBundle\Event\FormEvent; 6use FOS\UserBundle\Event\FormEvent;
7use FOS\UserBundle\Event\GetResponseUserEvent; 7use FOS\UserBundle\Event\GetResponseUserEvent;
8use FOS\UserBundle\Event\FilterUserResponseEvent; 8use FOS\UserBundle\FOSUserEvents;
9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpFoundation\RedirectResponse; 9use Symfony\Component\HttpFoundation\RedirectResponse;
10use Symfony\Component\HttpFoundation\Request;
11use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 11use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
12 12
13class ResettingController extends \FOS\UserBundle\Controller\ResettingController 13class ResettingController extends \FOS\UserBundle\Controller\ResettingController
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php
index e6528420..4bbb68dc 100644
--- a/src/Wallabag/UserBundle/Entity/User.php
+++ b/src/Wallabag/UserBundle/Entity/User.php
@@ -6,11 +6,11 @@ use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
7use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; 7use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
8use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; 8use Scheb\TwoFactorBundle\Model\TrustedComputerInterface;
9use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; 9use FOS\UserBundle\Model\User as BaseUser;
10use Symfony\Component\Security\Core\User\UserInterface;
11use JMS\Serializer\Annotation\ExclusionPolicy; 10use JMS\Serializer\Annotation\ExclusionPolicy;
12use JMS\Serializer\Annotation\Expose; 11use JMS\Serializer\Annotation\Expose;
13use FOS\UserBundle\Model\User as BaseUser; 12use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
13use Symfony\Component\Security\Core\User\UserInterface;
14use Wallabag\CoreBundle\Entity\Config; 14use Wallabag\CoreBundle\Entity\Config;
15use Wallabag\CoreBundle\Entity\Entry; 15use Wallabag\CoreBundle\Entity\Entry;
16 16
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/baggy/Registration/register.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/baggy/Registration/register.html.twig
index e5c1876b..2713bf45 100644
--- a/src/Wallabag/UserBundle/Resources/views/themes/baggy/Registration/register.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/themes/baggy/Registration/register.html.twig
@@ -8,7 +8,7 @@
8{% block messages %}{% endblock %} 8{% block messages %}{% endblock %}
9 9
10{% block content %} 10{% block content %}
11 <form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register"> 11 {{ form_start(form) }}
12 <fieldset class="w500p center"> 12 <fieldset class="w500p center">
13 <h2 class="mbs txtcenter">{% trans %}create an account{% endtrans %}</h2> 13 <h2 class="mbs txtcenter">{% trans %}create an account{% endtrans %}</h2>
14 {% include "FOSUserBundle:Registration:register_content.html.twig" %} 14 {% include "FOSUserBundle:Registration:register_content.html.twig" %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/ChangePassword/changePassword_content.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/ChangePassword/changePassword_content.html.twig
index e7b7318b..abb68421 100644
--- a/src/Wallabag/UserBundle/Resources/views/themes/material/ChangePassword/changePassword_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/ChangePassword/changePassword_content.html.twig
@@ -1,6 +1,6 @@
1{% trans_default_domain 'FOSUserBundle' %} 1{% trans_default_domain 'FOSUserBundle' %}
2 2
3<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password"> 3{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }}
4 <div class="card-content"> 4 <div class="card-content">
5 <div class="row"> 5 <div class="row">
6 {{ form_widget(form) }} 6 {{ form_widget(form) }}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig
index 865a24ae..e92b515e 100644
--- a/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Registration/register_content.html.twig
@@ -1,6 +1,6 @@
1{% trans_default_domain 'FOSUserBundle' %} 1{% trans_default_domain 'FOSUserBundle' %}
2 2
3<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register"> 3{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
4 <div class="card-content"> 4 <div class="card-content">
5 <div class="row"> 5 <div class="row">
6 6
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/passwordAlreadyRequested.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/passwordAlreadyRequested.html.twig
index 0eec4301..1e245372 100644
--- a/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/passwordAlreadyRequested.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/passwordAlreadyRequested.html.twig
@@ -5,7 +5,7 @@
5{% block fos_user_content %} 5{% block fos_user_content %}
6<div class="card-content"> 6<div class="card-content">
7 <div class="row"> 7 <div class="row">
8 {{ 'resetting.password_already_requested'|trans }} 8 {{ 'resetting.password_already_requested'|trans }}
9 </div> 9 </div>
10</div> 10</div>
11{% endblock fos_user_content %} 11{% endblock fos_user_content %}
diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/reset_content.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/reset_content.html.twig
index f7e061dd..9d0a061c 100644
--- a/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/reset_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Resetting/reset_content.html.twig
@@ -1,6 +1,6 @@
1{% trans_default_domain 'FOSUserBundle' %} 1{% trans_default_domain 'FOSUserBundle' %}
2 2
3<form action="{{ path('fos_user_resetting_reset', {'token': token}) }}" {{ form_enctype(form) }} method="POST" class="fos_user_resetting_reset"> 3{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'fos_user_resetting_reset' } }) }}
4 <div class="card-content"> 4 <div class="card-content">
5 <div class="row"> 5 <div class="row">
6 {{ form_widget(form) }} 6 {{ form_widget(form) }}