From 619cc45359ead519b64129181a07e14160fbbfcb Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Dec 2015 10:16:34 +0100 Subject: Symfony Upgrade Fixer FTW symfony-upgrade-fixer fix src/Wallabag/ --- .../Controller/WallabagRestController.php | 4 ++-- src/Wallabag/ApiBundle/Entity/AccessToken.php | 2 +- src/Wallabag/ApiBundle/Entity/AuthCode.php | 2 +- src/Wallabag/ApiBundle/Entity/Client.php | 2 +- src/Wallabag/ApiBundle/Entity/RefreshToken.php | 2 +- src/Wallabag/CoreBundle/Command/InstallCommand.php | 9 +++++---- .../CoreBundle/Controller/ConfigController.php | 8 ++++---- .../CoreBundle/Controller/EntryController.php | 8 ++++---- .../CoreBundle/Controller/RssController.php | 8 ++++---- .../CoreBundle/Controller/TagController.php | 4 ++-- .../DependencyInjection/WallabagCoreExtension.php | 4 ++-- src/Wallabag/CoreBundle/Entity/Entry.php | 2 +- src/Wallabag/CoreBundle/Entity/Tag.php | 4 ++-- src/Wallabag/CoreBundle/Entity/TaggingRule.php | 2 +- .../Subscriber/CustomDoctrineORMSubscriber.php | 2 +- .../CoreBundle/EventListener/LocaleListener.php | 2 +- .../RegistrationConfirmedListener.php | 4 ++-- src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 6 +++--- .../CoreBundle/Form/Type/ChangePasswordType.php | 11 +++++++---- src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 10 ++++++---- .../CoreBundle/Form/Type/EditEntryType.php | 11 +++++++---- src/Wallabag/CoreBundle/Form/Type/NewEntryType.php | 8 +++++--- src/Wallabag/CoreBundle/Form/Type/NewTagType.php | 8 +++++--- src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 14 +++++++++----- src/Wallabag/CoreBundle/Form/Type/RssType.php | 5 +++-- .../CoreBundle/Form/Type/TaggingRuleType.php | 8 +++++--- .../CoreBundle/Form/Type/UserInformationType.php | 14 +++++++++----- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 6 +++--- .../ParamConverter/UsernameRssTokenConverter.php | 2 +- .../CoreBundle/Resources/config/services.yml | 22 +++++++++++----------- .../Subscriber/TablePrefixSubscriber.php | 2 +- .../Tests/Command/InstallCommandTest.php | 12 ++++++------ .../Tests/EventListener/LocaleListenerTest.php | 6 +++--- .../RegistrationConfirmedListenerTest.php | 6 +++--- .../Tests/EventListener/UserLocaleListenerTest.php | 6 +++--- .../CoreBundle/Tests/Helper/ContentProxyTest.php | 2 +- .../Tests/Helper/RuleBasedTaggerTest.php | 2 +- .../UsernameRssTokenConverterTest.php | 2 +- .../Tests/Subscriber/TablePrefixSubscriberTest.php | 4 ++-- .../UserBundle/Controller/ResettingController.php | 6 +++--- src/Wallabag/UserBundle/Entity/User.php | 6 +++--- 41 files changed, 136 insertions(+), 112 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 354a6f8e..f8a2745a 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -3,13 +3,13 @@ namespace Wallabag\ApiBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; +use Hateoas\Configuration\Route; +use Hateoas\Representation\Factory\PagerfantaFactory; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; -use Hateoas\Configuration\Route; -use Hateoas\Representation\Factory\PagerfantaFactory; class WallabagRestController extends FOSRestController { 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 @@ namespace Wallabag\ApiBundle\Entity; -use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken; use Doctrine\ORM\Mapping as ORM; +use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken; /** * @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 @@ namespace Wallabag\ApiBundle\Entity; -use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode; use Doctrine\ORM\Mapping as ORM; +use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode; /** * @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 @@ namespace Wallabag\ApiBundle\Entity; -use FOS\OAuthServerBundle\Entity\Client as BaseClient; use Doctrine\ORM\Mapping as ORM; +use FOS\OAuthServerBundle\Entity\Client as BaseClient; /** * @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 @@ namespace Wallabag\ApiBundle\Entity; -use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken; use Doctrine\ORM\Mapping as ORM; +use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken; /** * @ORM\Table("oauth2_refresh_tokens") diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index e791d4dd..941cb8cd 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -3,15 +3,16 @@ namespace Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Question\Question; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Question\Question; use Wallabag\CoreBundle\Entity\Config; +use Wallabag\UserBundle\Entity\User; class InstallCommand extends ContainerAwareCommand { diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 7a187710..f51ccaa4 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -4,17 +4,17 @@ namespace Wallabag\CoreBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; -use Wallabag\CoreBundle\Form\Type\UserInformationType; -use Wallabag\CoreBundle\Form\Type\TaggingRuleType; use Wallabag\CoreBundle\Form\Type\NewUserType; use Wallabag\CoreBundle\Form\Type\RssType; +use Wallabag\CoreBundle\Form\Type\TaggingRuleType; +use Wallabag\CoreBundle\Form\Type\UserInformationType; use Wallabag\CoreBundle\Tools\Utils; +use Wallabag\UserBundle\Entity\User; class ConfigController extends Controller { diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 37f7ab60..c1b5a71b 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -2,16 +2,16 @@ namespace Wallabag\CoreBundle\Controller; +use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\CoreBundle\Form\Type\NewEntryType; -use Wallabag\CoreBundle\Form\Type\EditEntryType; use Wallabag\CoreBundle\Filter\EntryFilterType; -use Pagerfanta\Adapter\DoctrineORMAdapter; -use Pagerfanta\Pagerfanta; +use Wallabag\CoreBundle\Form\Type\EditEntryType; +use Wallabag\CoreBundle\Form\Type\NewEntryType; class EntryController extends Controller { 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 @@ namespace Wallabag\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Entity\Entry; -use Pagerfanta\Adapter\DoctrineORMAdapter; -use Pagerfanta\Pagerfanta; +use Wallabag\UserBundle\Entity\User; class RssController extends Controller { diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 64d53f0c..682cc6e6 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; -use Wallabag\CoreBundle\Form\Type\NewTagType; -use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\CoreBundle\Form\Type\NewTagType; class TagController extends Controller { 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 @@ namespace Wallabag\CoreBundle\DependencyInjection; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; class WallabagCoreExtension extends Extension { 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; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Validator\Constraints as Assert; use Hateoas\Configuration\Annotation as Hateoas; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; +use Symfony\Component\Validator\Constraints as Assert; use Wallabag\UserBundle\Entity\User; /** 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 @@ namespace Wallabag\CoreBundle\Entity; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use JMS\Serializer\Annotation\XmlRoot; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; -use Doctrine\Common\Collections\ArrayCollection; use Gedmo\Mapping\Annotation as Gedmo; +use JMS\Serializer\Annotation\XmlRoot; /** * 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 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Validator\Constraints as Assert; use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; +use Symfony\Component\Validator\Constraints as Assert; /** * 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 @@ namespace Wallabag\CoreBundle\Event\Subscriber; -use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber; use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent; +use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** 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 @@ namespace Wallabag\CoreBundle\EventListener; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * @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 @@ namespace Wallabag\CoreBundle\EventListener; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Doctrine\ORM\EntityManager; use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\FOSUserEvents; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Wallabag\CoreBundle\Entity\Config; class RegistrationConfirmedListener implements EventSubscriberInterface diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 32de21ca..e0a1cb31 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -2,11 +2,11 @@ namespace Wallabag\CoreBundle\Filter; +use Doctrine\ORM\EntityRepository; +use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; -use Doctrine\ORM\EntityRepository; use Wallabag\UserBundle\Entity\User; class EntryFilterType extends AbstractType @@ -77,7 +77,7 @@ class EntryFilterType extends AbstractType ; } - public function getName() + public function getBlockPrefix() { return 'entry_filter'; } diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 82e1954d..615b8169 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -3,6 +3,9 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Symfony\Component\Form\Extension\Core\Type\RepeatedType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; use Symfony\Component\Validator\Constraints; @@ -12,10 +15,10 @@ class ChangePasswordType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('old_password', 'password', array( + ->add('old_password', PasswordType::class, array( 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), )) - ->add('new_password', 'repeated', array( + ->add('new_password', RepeatedType::class, array( 'type' => 'password', 'invalid_message' => 'The password fields must match.', 'required' => true, @@ -29,11 +32,11 @@ class ChangePasswordType extends AbstractType new Constraints\NotBlank(), ), )) - ->add('save', 'submit') + ->add('save', SubmitType::class) ; } - public function getName() + public function getBlockPrefix() { return 'change_passwd'; } diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 1f0ad89d..88082a04 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -3,6 +3,8 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -28,15 +30,15 @@ class ConfigType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('theme', 'choice', array( + ->add('theme', ChoiceType::class, array( 'choices' => array_flip($this->themes), 'choices_as_values' => true, )) ->add('items_per_page') - ->add('language', 'choice', array( + ->add('language', ChoiceType::class, array( 'choices' => $this->languages, )) - ->add('save', 'submit') + ->add('save', SubmitType::class) ; } @@ -47,7 +49,7 @@ class ConfigType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'config'; } 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 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,14 +14,14 @@ class EditEntryType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('title', 'text', array('required' => true)) - ->add('is_public', 'checkbox', array('required' => false)) + ->add('title', TextType::class, array('required' => true)) + ->add('is_public', CheckboxType::class, array('required' => false)) // @todo: add autocomplete // ->add('tags', 'entity', array( // 'class' => 'Wallabag\CoreBundle\Entity\Tag', // 'choice_translation_domain' => true, // )) - ->add('save', 'submit') + ->add('save', SubmitType::class) ; } @@ -29,7 +32,7 @@ class EditEntryType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'entry'; } 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 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,8 +13,8 @@ class NewEntryType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('url', 'url', array('required' => true)) - ->add('save', 'submit') + ->add('url', UrlType::class, array('required' => true)) + ->add('save', SubmitType::class) ; } @@ -23,7 +25,7 @@ class NewEntryType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'entry'; } 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 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,8 +13,8 @@ class NewTagType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('label', 'text', array('required' => true)) - ->add('save', 'submit') + ->add('label', TextType::class, array('required' => true)) + ->add('save', SubmitType::class) ; } @@ -23,7 +25,7 @@ class NewTagType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'tag'; } diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index 8aabc8bb..e6fff976 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -3,6 +3,10 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\RepeatedType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints; @@ -12,8 +16,8 @@ class NewUserType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('username', 'text', array('required' => true)) - ->add('plainPassword', 'repeated', array( + ->add('username', TextType::class, array('required' => true)) + ->add('plainPassword', RepeatedType::class, array( 'type' => 'password', 'constraints' => array( new Constraints\Length(array( @@ -23,8 +27,8 @@ class NewUserType extends AbstractType new Constraints\NotBlank(), ), )) - ->add('email', 'email') - ->add('save', 'submit') + ->add('email', EmailType::class) + ->add('save', SubmitType::class) ; } @@ -35,7 +39,7 @@ class NewUserType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'new_user'; } 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 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -12,7 +13,7 @@ class RssType extends AbstractType { $builder ->add('rss_limit') - ->add('save', 'submit') + ->add('save', SubmitType::class) ; } @@ -23,7 +24,7 @@ class RssType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'rss_config'; } diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php index 428d94b3..296cec9e 100644 --- a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php +++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php @@ -3,6 +3,8 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer; @@ -12,8 +14,8 @@ class TaggingRuleType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('rule', 'text', array('required' => true)) - ->add('save', 'submit') + ->add('rule', TextType::class, array('required' => true)) + ->add('save', SubmitType::class) ; $tagsField = $builder @@ -30,7 +32,7 @@ class TaggingRuleType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'tagging_rule'; } diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php index e06c937d..f52e409a 100644 --- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php +++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php @@ -3,6 +3,10 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -11,10 +15,10 @@ class UserInformationType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', 'text') - ->add('email', 'email') - ->add('twoFactorAuthentication', 'checkbox', array('required' => false)) - ->add('save', 'submit') + ->add('name', TextType::class) + ->add('email', EmailType::class) + ->add('twoFactorAuthentication', CheckboxType::class, array('required' => false)) + ->add('save', SubmitType::class) ->remove('username') ->remove('plainPassword') ; @@ -32,7 +36,7 @@ class UserInformationType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'update_user'; } 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 @@ namespace Wallabag\CoreBundle\Helper; +use JMS\Serializer; +use JMS\Serializer\SerializationContext; +use JMS\Serializer\SerializerBuilder; use PHPePub\Core\EPub; use PHPePub\Core\Structure\OPF\DublinCore; use Symfony\Component\HttpFoundation\Response; -use JMS\Serializer; -use JMS\Serializer\SerializerBuilder; -use JMS\Serializer\SerializationContext; /** * 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 @@ namespace Wallabag\CoreBundle\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface; use Doctrine\Common\Persistence\ManagerRegistry; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; +use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Wallabag\UserBundle\Entity\User; diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 96b1c931..80f737f8 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -2,7 +2,7 @@ services: wallabag_core.helper.detect_active_theme: class: Wallabag\CoreBundle\Helper\DetectActiveTheme arguments: - - @security.token_storage + - "@security.token_storage" - %theme% # default theme from parameters.yml # custom form type @@ -22,7 +22,7 @@ services: wallabag_core.form.type.forgot_password: class: Wallabag\CoreBundle\Form\Type\ForgotPasswordType arguments: - - @doctrine + - "@doctrine" tags: - { name: form.type, alias: forgot_password } @@ -31,7 +31,7 @@ services: tags: - { name: request.param_converter, converter: username_rsstoken_converter } arguments: - - @doctrine + - "@doctrine" wallabag_core.table_prefix_subscriber: class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber @@ -45,23 +45,23 @@ services: arguments: - { error_message: false } calls: - - [ setLogger, [ @logger ] ] + - [ setLogger, [ "@logger" ] ] tags: - { name: monolog.logger, channel: graby } wallabag_core.content_proxy: class: Wallabag\CoreBundle\Helper\ContentProxy arguments: - - @wallabag_core.graby - - @wallabag_core.rule_based_tagger - - @logger + - "@wallabag_core.graby" + - "@wallabag_core.rule_based_tagger" + - "@logger" wallabag_core.rule_based_tagger: class: Wallabag\CoreBundle\Helper\RuleBasedTagger arguments: - - @rulerz - - @wallabag_core.tag_repository - - @wallabag_core.entry_repository + - "@rulerz" + - "@wallabag_core.tag_repository" + - "@wallabag_core.entry_repository" # repository as a service wallabag_core.entry_repository: @@ -79,7 +79,7 @@ services: wallabag_core.registration_confirmed: class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener arguments: - - @doctrine.orm.entity_manager + - "@doctrine.orm.entity_manager" - %theme% - %items_on_page% - %rss_limit% 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 @@ namespace Wallabag\CoreBundle\Subscriber; -use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\Common\EventSubscriber; +use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\Mapping\ClassMetadataInfo; /** 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 @@ namespace Wallabag\CoreBundle\Tests\Command; -use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; -use Wallabag\CoreBundle\Command\InstallCommand; -use Wallabag\CoreBundle\Tests\Mock\InstallCommandMock; +use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; +use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; -use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; -use Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand; -use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand; +use Symfony\Component\Console\Tester\CommandTester; +use Wallabag\CoreBundle\Command\InstallCommand; +use Wallabag\CoreBundle\Tests\Mock\InstallCommandMock; +use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; class InstallCommandTest extends WallabagCoreTestCase { 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; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpKernel\KernelEvents; use Wallabag\CoreBundle\EventListener\LocaleListener; class 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 @@ namespace Wallabag\CoreBundle\Tests\EventListener; +use FOS\UserBundle\Event\FilterUserResponseEvent; +use FOS\UserBundle\FOSUserEvents; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use FOS\UserBundle\FOSUserEvents; -use FOS\UserBundle\Event\FilterUserResponseEvent; -use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; use Wallabag\CoreBundle\Entity\Config; +use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; use Wallabag\UserBundle\Entity\User; class 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 @@ namespace Wallabag\CoreBundle\Tests\EventListener; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; -use Wallabag\CoreBundle\EventListener\UserLocaleListener; +use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use Wallabag\CoreBundle\Entity\Config; +use Wallabag\CoreBundle\EventListener\UserLocaleListener; use Wallabag\UserBundle\Entity\User; class 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; use Psr\Log\NullLogger; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Helper\ContentProxy; +use Wallabag\UserBundle\Entity\User; class ContentProxyTest extends \PHPUnit_Framework_TestCase { 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; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\TaggingRule; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Helper\RuleBasedTagger; +use Wallabag\UserBundle\Entity\User; class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase { 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 @@ namespace Wallabag\CoreBundle\Tests\Command; -use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Component\HttpFoundation\Request; +use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter; use Wallabag\UserBundle\Entity\User; class 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 @@ namespace Wallabag\CoreBundle\Tests\Subscriber; -use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\Common\EventManager; +use Doctrine\ORM\Event\LoadClassMetadataEventArgs; +use Doctrine\ORM\Mapping\ClassMetadata; use Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber; class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase 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 @@ namespace Wallabag\UserBundle\Controller; -use FOS\UserBundle\FOSUserEvents; +use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\Event\GetResponseUserEvent; -use FOS\UserBundle\Event\FilterUserResponseEvent; -use Symfony\Component\HttpFoundation\Request; +use FOS\UserBundle\FOSUserEvents; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class 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; use Doctrine\ORM\Mapping as ORM; use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; -use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; -use Symfony\Component\Security\Core\User\UserInterface; +use FOS\UserBundle\Model\User as BaseUser; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; -use FOS\UserBundle\Model\User as BaseUser; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; +use Symfony\Component\Security\Core\User\UserInterface; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; -- cgit v1.2.3 From 5c895a7fd15822856fb407910264c5d95e1e223c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Dec 2015 13:00:37 +0100 Subject: Update bundle & stock file - update stock file (AppKernel, app.php, etc ..) from SymfonyStandard edition) - update bundle to latest release - remove security on profiler --- .../CoreBundle/Controller/ConfigController.php | 13 +++++++------ .../CoreBundle/Controller/EntryController.php | 6 +++--- .../CoreBundle/Controller/TagController.php | 2 +- src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 22 ++++++++++++++-------- .../CoreBundle/Form/Type/ChangePasswordType.php | 2 +- src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 3 ++- src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 3 ++- .../CoreBundle/Form/Type/TaggingRuleType.php | 2 +- .../CoreBundle/Resources/config/services.yml | 18 +++--------------- .../views/themes/baggy/Config/index.html.twig | 2 +- .../themes/baggy/Registration/register.html.twig | 2 +- .../changePassword_content.html.twig | 2 +- .../Registration/register_content.html.twig | 2 +- .../Resetting/passwordAlreadyRequested.html.twig | 2 +- .../material/Resetting/reset_content.html.twig | 2 +- 15 files changed, 40 insertions(+), 43 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index f51ccaa4..d0cf91de 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; +use Wallabag\CoreBundle\Form\Type\ConfigType; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; use Wallabag\CoreBundle\Form\Type\NewUserType; use Wallabag\CoreBundle\Form\Type\RssType; @@ -31,7 +32,7 @@ class ConfigController extends Controller $user = $this->getUser(); // handle basic config detail (this form is defined as a service) - $configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config'))); + $configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config'))); $configForm->handleRequest($request); if ($configForm->isValid()) { @@ -51,7 +52,7 @@ class ConfigController extends Controller } // handle changing password - $pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4')); + $pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4')); $pwdForm->handleRequest($request); if ($pwdForm->isValid()) { @@ -67,7 +68,7 @@ class ConfigController extends Controller } // handle changing user information - $userForm = $this->createForm(new UserInformationType(), $user, array( + $userForm = $this->createForm(UserInformationType::class, $user, array( 'validation_groups' => array('Profile'), 'action' => $this->generateUrl('config').'#set3', )); @@ -85,7 +86,7 @@ class ConfigController extends Controller } // handle rss information - $rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2')); + $rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2')); $rssForm->handleRequest($request); if ($rssForm->isValid()) { @@ -102,7 +103,7 @@ class ConfigController extends Controller // handle tagging rule $taggingRule = new TaggingRule(); - $newTaggingRule = $this->createForm(new TaggingRuleType(), $taggingRule, array('action' => $this->generateUrl('config').'#set5')); + $newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5')); $newTaggingRule->handleRequest($request); if ($newTaggingRule->isValid()) { @@ -122,7 +123,7 @@ class ConfigController extends Controller $newUser = $userManager->createUser(); // enable created user by default $newUser->setEnabled(true); - $newUserForm = $this->createForm(new NewUserType(), $newUser, array( + $newUserForm = $this->createForm(NewUserType::class, $newUser, array( 'validation_groups' => array('Profile'), 'action' => $this->generateUrl('config').'#set5', )); diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index c1b5a71b..83e5b57d 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -43,7 +43,7 @@ class EntryController extends Controller { $entry = new Entry($this->getUser()); - $form = $this->createForm(new NewEntryType(), $entry); + $form = $this->createForm(NewEntryType::class, $entry); $form->handleRequest($request); @@ -117,7 +117,7 @@ class EntryController extends Controller { $this->checkUserAction($entry); - $form = $this->createForm(new EditEntryType(), $entry); + $form = $this->createForm(EditEntryType::class, $entry); $form->handleRequest($request); @@ -234,7 +234,7 @@ class EntryController extends Controller throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); } - $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser())); + $form = $this->createForm(new EntryFilterType($repository, $this->getUser())); if ($request->query->has($form->getName())) { // manually bind values from the request diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 682cc6e6..ff4d64a8 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -21,7 +21,7 @@ class TagController extends Controller public function addTagFormAction(Request $request, Entry $entry) { $tag = new Tag(); - $form = $this->createForm(new NewTagType(), $tag); + $form = $this->createForm(NewTagType::class, $tag); $form->handleRequest($request); if ($form->isValid()) { diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index e0a1cb31..4430c971 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -4,6 +4,11 @@ namespace Wallabag\CoreBundle\Filter; use Doctrine\ORM\EntityRepository; use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; +use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType; +use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType; +use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType; +use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType; +use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -29,8 +34,8 @@ class EntryFilterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('readingTime', 'filter_number_range') - ->add('createdAt', 'filter_date_range', array( + ->add('readingTime', NumberRangeFilterType::class) + ->add('createdAt', DateRangeFilterType::class, array( 'left_date_options' => array( 'attr' => array( 'placeholder' => 'dd/mm/yyyy', @@ -47,7 +52,7 @@ class EntryFilterType extends AbstractType ), ) ) - ->add('domainName', 'filter_text', array( + ->add('domainName', TextFilterType::class, array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; if (strlen($value) <= 2 || empty($value)) { @@ -58,9 +63,9 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, )) - ->add('isArchived', 'filter_checkbox') - ->add('isStarred', 'filter_checkbox') - ->add('previewPicture', 'filter_checkbox', array( + ->add('isArchived', CheckboxFilterType::class) + ->add('isStarred', CheckboxFilterType::class) + ->add('previewPicture', CheckboxFilterType::class, array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) { return; @@ -71,8 +76,9 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, )) - ->add('language', 'filter_choice', array( - 'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()), + ->add('language', ChoiceFilterType::class, array( + 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), + 'choices_as_values' => true, )) ; } diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 615b8169..7d05a5d8 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -19,7 +19,7 @@ class ChangePasswordType extends AbstractType 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), )) ->add('new_password', RepeatedType::class, array( - 'type' => 'password', + 'type' => PasswordType::class, 'invalid_message' => 'The password fields must match.', 'required' => true, 'first_options' => array('label' => 'New password'), diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 88082a04..a139f2df 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -36,7 +36,8 @@ class ConfigType extends AbstractType )) ->add('items_per_page') ->add('language', ChoiceType::class, array( - 'choices' => $this->languages, + 'choices' => array_flip($this->languages), + 'choices_as_values' => true, )) ->add('save', SubmitType::class) ; diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index e6fff976..ffbe9ba2 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\Extension\Core\Type\RepeatedType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextType; @@ -18,7 +19,7 @@ class NewUserType extends AbstractType $builder ->add('username', TextType::class, array('required' => true)) ->add('plainPassword', RepeatedType::class, array( - 'type' => 'password', + 'type' => PasswordType::class, 'constraints' => array( new Constraints\Length(array( 'min' => 8, diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php index 296cec9e..5815b8c6 100644 --- a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php +++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleType.php @@ -19,7 +19,7 @@ class TaggingRuleType extends AbstractType ; $tagsField = $builder - ->create('tags', 'text') + ->create('tags', TextType::class) ->addModelTransformer(new StringToListTransformer(',')); $builder->add($tagsField); diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 80f737f8..e8dafc5d 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -12,19 +12,7 @@ services: - %liip_theme.themes% - %wallabag_core.languages% tags: - - { name: form.type, alias: config } - - wallabag_core.form.registration: - class: Wallabag\CoreBundle\Form\Type\RegistrationType - tags: - - { name: form.type, alias: wallabag_user_registration } - - wallabag_core.form.type.forgot_password: - class: Wallabag\CoreBundle\Form\Type\ForgotPasswordType - arguments: - - "@doctrine" - tags: - - { name: form.type, alias: forgot_password } + - { name: form.type } wallabag_core.param_converter.username_rsstoken_converter: class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter @@ -66,13 +54,13 @@ services: # repository as a service wallabag_core.entry_repository: class: Wallabag\CoreBundle\Repository\EntryRepository - factory: [ @doctrine.orm.default_entity_manager, getRepository ] + factory: [ "@doctrine.orm.default_entity_manager", getRepository ] arguments: - WallabagCoreBundle:Entry wallabag_core.tag_repository: class: Wallabag\CoreBundle\Repository\TagRepository - factory: [ @doctrine.orm.default_entity_manager, getRepository ] + factory: [ "@doctrine.orm.default_entity_manager", getRepository ] arguments: - WallabagCoreBundle:Tag 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 @@ {% endfor %} -
+ {{ form_start(form.new_tagging_rule) }} {{ form_errors(form.new_tagging_rule) }}
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 @@ {% block messages %}{% endblock %} {% block content %} - + {{ form_start(form) }}

{% trans %}create an account{% endtrans %}

{% 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 @@ {% trans_default_domain 'FOSUserBundle' %} - +{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }}
{{ 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 @@ {% trans_default_domain 'FOSUserBundle' %} - +{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
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 @@ {% block fos_user_content %}
- {{ 'resetting.password_already_requested'|trans }} + {{ 'resetting.password_already_requested'|trans }}
{% 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 @@ {% trans_default_domain 'FOSUserBundle' %} - +{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'fos_user_resetting_reset' } }) }}
{{ form_widget(form) }} -- cgit v1.2.3 From 1d76102a240c2596832848128a7b9cf5aa2050dd Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 9 Jan 2016 18:38:40 +0100 Subject: Fix recent update - some missing url parameters from WallabagRestController & EntryController - use a service for `EntryFilterType` to use fully qualified name instead (so changing class signature) - update ImportBundle (url & form) --- .../ApiBundle/Controller/WallabagRestController.php | 3 ++- .../CoreBundle/Controller/EntryController.php | 2 +- src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 20 ++++++++++---------- .../CoreBundle/Form/Type/UserInformationType.php | 2 +- .../CoreBundle/Resources/config/services.yml | 8 ++++++++ .../ImportBundle/Controller/PocketController.php | 5 +++-- .../ImportBundle/Controller/WallabagV1Controller.php | 2 +- .../ImportBundle/Form/Type/UploadImportType.php | 8 +++++--- 8 files changed, 31 insertions(+), 19 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index f8a2745a..d9035cac 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -8,6 +8,7 @@ use Hateoas\Representation\Factory\PagerfantaFactory; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; @@ -84,7 +85,7 @@ class WallabagRestController extends FOSRestController $pagerfantaFactory = new PagerfantaFactory('page', 'perPage'); $paginatedCollection = $pagerfantaFactory->createRepresentation( $pager, - new Route('api_get_entries', [], $absolute = true) + new Route('api_get_entries', [], UrlGeneratorInterface::ABSOLUTE_URL) ); $json = $this->get('serializer')->serialize($paginatedCollection, 'json'); diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 83e5b57d..dda0a456 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -234,7 +234,7 @@ class EntryController extends Controller throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); } - $form = $this->createForm(new EntryFilterType($repository, $this->getUser())); + $form = $this->createForm(EntryFilterType::class); if ($request->query->has($form->getName())) { // manually bind values from the request diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 4430c971..c38be832 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -12,7 +12,7 @@ use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Wallabag\UserBundle\Entity\User; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; class EntryFilterType extends AbstractType { @@ -23,12 +23,12 @@ class EntryFilterType extends AbstractType * Repository & user are used to get a list of language entries for this user. * * @param EntityRepository $entryRepository - * @param User $user + * @param TokenStorage $token */ - public function __construct(EntityRepository $entryRepository, User $user) + public function __construct(EntityRepository $entryRepository, TokenStorage $token) { $this->repository = $entryRepository; - $this->user = $user; + $this->user = $token->getToken()->getUser(); } public function buildForm(FormBuilderInterface $builder, array $options) @@ -54,13 +54,13 @@ class EntryFilterType extends AbstractType ) ->add('domainName', TextFilterType::class, array( 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { - $value = $values['value']; - if (strlen($value) <= 2 || empty($value)) { - return; - } - $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); + $value = $values['value']; + if (strlen($value) <= 2 || empty($value)) { + return; + } + $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); - return $filterQuery->createCondition($expression); + return $filterQuery->createCondition($expression); }, )) ->add('isArchived', CheckboxFilterType::class) diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php index f52e409a..f491b0ae 100644 --- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php +++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php @@ -26,7 +26,7 @@ class UserInformationType extends AbstractType public function getParent() { - return 'fos_user_registration'; + return 'FOS\UserBundle\Form\Type\RegistrationFormType'; } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index e8dafc5d..43600735 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -14,6 +14,14 @@ services: tags: - { name: form.type } + wallabag_core.filter.type.entry: + class: Wallabag\CoreBundle\Filter\EntryFilterType + arguments: + - "@wallabag_core.entry_repository" + - "@security.token_storage" + tags: + - { name: form.type } + wallabag_core.param_converter.username_rsstoken_converter: class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter tags: diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index a0853383..72dc2696 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -3,6 +3,7 @@ namespace Wallabag\ImportBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; class PocketController extends Controller @@ -23,12 +24,12 @@ class PocketController extends Controller public function authAction() { $requestToken = $this->get('wallabag_import.pocket.import') - ->getRequestToken($this->generateUrl('import', [], true)); + ->getRequestToken($this->generateUrl('import', UrlGeneratorInterface::ABSOLUTE_URL)); $this->get('session')->set('import.pocket.code', $requestToken); return $this->redirect( - 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], true), + 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', UrlGeneratorInterface::ABSOLUTE_URL), 301 ); } 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 */ public function indexAction(Request $request) { - $form = $this->createForm(new UploadImportType()); + $form = $this->createForm(UploadImportType::class); $form->handleRequest($request); $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; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\FileType; class UploadImportType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('file', 'file') - ->add('save', 'submit') + ->add('file', FileType::class) + ->add('save', SubmitType::class) ; } - public function getName() + public function getBlockPrefix() { return 'upload_import_file'; } -- cgit v1.2.3 From 27e475a9412b0b462da2ddff641fddbeac5c165e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 13 Jan 2016 22:53:36 +0100 Subject: Fix Pocket generateUrl parameters --- src/Wallabag/ImportBundle/Controller/PocketController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 72dc2696..7aee302f 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -24,12 +24,12 @@ class PocketController extends Controller public function authAction() { $requestToken = $this->get('wallabag_import.pocket.import') - ->getRequestToken($this->generateUrl('import', UrlGeneratorInterface::ABSOLUTE_URL)); + ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL)); $this->get('session')->set('import.pocket.code', $requestToken); return $this->redirect( - 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', UrlGeneratorInterface::ABSOLUTE_URL), + 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL), 301 ); } -- cgit v1.2.3 From c7f622d3699b7f65ee75bcd5d409ad2027e9b6a4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 15 Jan 2016 09:34:09 +0100 Subject: Update readme & fix console permission --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 941cb8cd..da099a19 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -12,7 +12,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; use Wallabag\CoreBundle\Entity\Config; -use Wallabag\UserBundle\Entity\User; class InstallCommand extends ContainerAwareCommand { @@ -56,7 +55,7 @@ class InstallCommand extends ContainerAwareCommand ; $output->writeln('Wallabag has been successfully installed.'); - $output->writeln('Just execute `php app/console server:run` for using wallabag: http://localhost:8000'); + $output->writeln('Just execute `php bin/console server:run` for using wallabag: http://localhost:8000'); } protected function checkRequirements() -- cgit v1.2.3