diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
commit | f808b01692a835673f328d7221ba8c212caa9b61 (patch) | |
tree | 0c3b1fc5b1ddbd7af72227303503177689e1d403 /src/Wallabag/ImportBundle/Controller/PinboardController.php | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
download | wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.gz wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.zst wallabag-f808b01692a835673f328d7221ba8c212caa9b61.zip |
Add a real configuration for CS-Fixer
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/PinboardController.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/PinboardController.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/ImportBundle/Controller/PinboardController.php index d0ad8aa8..0e57fd41 100644 --- a/src/Wallabag/ImportBundle/Controller/PinboardController.php +++ b/src/Wallabag/ImportBundle/Controller/PinboardController.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | 5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
7 | use Symfony\Component\HttpFoundation\Request; | 7 | use Symfony\Component\HttpFoundation\Request; |
8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; | 8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; |
9 | 9 | ||
@@ -29,11 +29,11 @@ class PinboardController extends Controller | |||
29 | if ($form->isSubmitted() && $form->isValid()) { | 29 | if ($form->isSubmitted() && $form->isValid()) { |
30 | $file = $form->get('file')->getData(); | 30 | $file = $form->get('file')->getData(); |
31 | $markAsRead = $form->get('mark_as_read')->getData(); | 31 | $markAsRead = $form->get('mark_as_read')->getData(); |
32 | $name = 'pinboard_'.$this->getUser()->getId().'.json'; | 32 | $name = 'pinboard_' . $this->getUser()->getId() . '.json'; |
33 | 33 | ||
34 | if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { | 34 | if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { |
35 | $res = $pinboard | 35 | $res = $pinboard |
36 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) | 36 | ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) |
37 | ->setMarkAsRead($markAsRead) | 37 | ->setMarkAsRead($markAsRead) |
38 | ->import(); | 38 | ->import(); |
39 | 39 | ||
@@ -52,7 +52,7 @@ class PinboardController extends Controller | |||
52 | ]); | 52 | ]); |
53 | } | 53 | } |
54 | 54 | ||
55 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); | 55 | unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); |
56 | } | 56 | } |
57 | 57 | ||
58 | $this->get('session')->getFlashBag()->add( | 58 | $this->get('session')->getFlashBag()->add( |
@@ -61,12 +61,12 @@ class PinboardController extends Controller | |||
61 | ); | 61 | ); |
62 | 62 | ||
63 | return $this->redirect($this->generateUrl('homepage')); | 63 | return $this->redirect($this->generateUrl('homepage')); |
64 | } else { | ||
65 | $this->get('session')->getFlashBag()->add( | ||
66 | 'notice', | ||
67 | 'flashes.import.notice.failed_on_file' | ||
68 | ); | ||
69 | } | 64 | } |
65 | |||
66 | $this->get('session')->getFlashBag()->add( | ||
67 | 'notice', | ||
68 | 'flashes.import.notice.failed_on_file' | ||
69 | ); | ||
70 | } | 70 | } |
71 | 71 | ||
72 | return $this->render('WallabagImportBundle:Pinboard:index.html.twig', [ | 72 | return $this->render('WallabagImportBundle:Pinboard:index.html.twig', [ |