From 7df80cb32ca9b7d0fe452320ddc3563a1e373e2f Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 31 Jan 2015 19:09:34 +0100 Subject: CS --- .../CoreBundle/Controller/EntryController.php | 19 ++++++-------- .../CoreBundle/Controller/SecurityController.php | 3 ++- .../Controller/WallabagRestController.php | 30 ++++++++-------------- 3 files changed, 21 insertions(+), 31 deletions(-) (limited to 'src/Wallabag/CoreBundle/Controller') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 25f18711..377a45ae 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -8,14 +8,12 @@ use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Repository; use Wallabag\CoreBundle\Entity\Entries; use Wallabag\CoreBundle\Service\Extractor; -use Wallabag\CoreBundle\Helper\Tools; use Wallabag\CoreBundle\Helper\Url; class EntryController extends Controller { - /** - * @param Request $request + * @param Request $request * @Route("/new", name="new_entry") * @return \Symfony\Component\HttpFoundation\Response */ @@ -32,7 +30,6 @@ class EntryController extends Controller $form->handleRequest($request); if ($form->isValid()) { - $content = Extractor::extract($entry->getUrl()); $entry->setTitle($content->getTitle()); @@ -115,7 +112,7 @@ class EntryController extends Controller /** * Shows entry content * - * @param Entries $entry + * @param Entries $entry * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") * @return \Symfony\Component\HttpFoundation\Response */ @@ -130,8 +127,8 @@ class EntryController extends Controller /** * Changes read status for an entry * - * @param Request $request - * @param Entries $entry + * @param Request $request + * @param Entries $entry * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") * @return \Symfony\Component\HttpFoundation\RedirectResponse */ @@ -151,8 +148,8 @@ class EntryController extends Controller /** * Changes favorite status for an entry * - * @param Request $request - * @param Entries $entry + * @param Request $request + * @param Entries $entry * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") * @return \Symfony\Component\HttpFoundation\RedirectResponse */ @@ -172,8 +169,8 @@ class EntryController extends Controller /** * Deletes entry * - * @param Request $request - * @param Entries $entry + * @param Request $request + * @param Entries $entry * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") * @return \Symfony\Component\HttpFoundation\RedirectResponse */ diff --git a/src/Wallabag/CoreBundle/Controller/SecurityController.php b/src/Wallabag/CoreBundle/Controller/SecurityController.php index 51f9cc26..c2901da2 100644 --- a/src/Wallabag/CoreBundle/Controller/SecurityController.php +++ b/src/Wallabag/CoreBundle/Controller/SecurityController.php @@ -18,10 +18,11 @@ class SecurityController extends Controller $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); $session->remove(SecurityContext::AUTHENTICATION_ERROR); } + return $this->render('WallabagCoreBundle:Security:login.html.twig', array( // last username entered by the user 'last_username' => $session->get(SecurityContext::LAST_USERNAME), 'error' => $error, )); } -} \ No newline at end of file +} diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index 8e018e88..5668d934 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -3,7 +3,6 @@ namespace Wallabag\CoreBundle\Controller; use Nelmio\ApiDocBundle\Annotation\ApiDoc; -use FOS\RestBundle\Controller\Annotations\View; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Entity\Entries; @@ -12,7 +11,6 @@ use Wallabag\CoreBundle\Service\Extractor; class WallabagRestController extends Controller { - /** * Retrieve all entries. It could be filtered by many options. * @@ -44,14 +42,13 @@ class WallabagRestController extends Controller $entries = $this ->getDoctrine() ->getRepository('WallabagCoreBundle:Entries') - ->findEntries(1, (int)$isArchived, (int)$isStarred, (int)$isDeleted, $sort, $order); + ->findEntries(1, (int) $isArchived, (int) $isStarred, (int) $isDeleted, $sort, $order); - if(!is_array($entries)) { + if (!is_array($entries)) { throw $this->createNotFoundException(); } return $entries; - } /** @@ -119,7 +116,6 @@ class WallabagRestController extends Controller */ public function patchEntriesAction(Entries $entry) { - } /** @@ -133,10 +129,8 @@ class WallabagRestController extends Controller */ public function deleteEntriesAction(Entries $entry) { - } - /** * Retrieve all tags for an entry * @@ -146,8 +140,8 @@ class WallabagRestController extends Controller * } * ) */ - public function getEntriesTagsAction(Entries $entry) { - + public function getEntriesTagsAction(Entries $entry) + { } /** @@ -162,8 +156,8 @@ class WallabagRestController extends Controller * } * ) */ - public function postEntriesTagsAction(Entries $entry) { - + public function postEntriesTagsAction(Entries $entry) + { } /** @@ -178,7 +172,6 @@ class WallabagRestController extends Controller */ public function deleteEntriesTagsAction(Entries $entry, Tags $tag) { - } /** @@ -187,8 +180,8 @@ class WallabagRestController extends Controller * @ApiDoc( * ) */ - public function getTagsAction() { - + public function getTagsAction() + { } /** @@ -200,8 +193,8 @@ class WallabagRestController extends Controller * } * ) */ - public function getTagAction(Tags $tag) { - + public function getTagAction(Tags $tag) + { } /** @@ -215,6 +208,5 @@ class WallabagRestController extends Controller */ public function deleteTagAction(Tags $tag) { - } -} \ No newline at end of file +} -- cgit v1.2.3