aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/EntryRestController.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-07-03 13:39:54 +0200
committerGitHub <noreply@github.com>2017-07-03 13:39:54 +0200
commit71e1cbc8eb5928d393b0772055d6b711e90a09b3 (patch)
tree71795eadcf13fda9198b8cd9a3da26d51826bbd9 /src/Wallabag/ApiBundle/Controller/EntryRestController.php
parent822c877949aff8ae57677671115f8f4fc69588d5 (diff)
parent38520658addc217f127b0627ea28dcf8d6e6178c (diff)
downloadwallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.gz
wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.zst
wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.zip
Merge pull request #3258 from wallabag/cs-fixer
Add a real configuration for CS-Fixer
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/EntryRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index c7938633..ca460c84 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -6,14 +6,14 @@ use Hateoas\Configuration\Route;
6use Hateoas\Representation\Factory\PagerfantaFactory; 6use Hateoas\Representation\Factory\PagerfantaFactory;
7use JMS\Serializer\SerializationContext; 7use JMS\Serializer\SerializationContext;
8use Nelmio\ApiDocBundle\Annotation\ApiDoc; 8use Nelmio\ApiDocBundle\Annotation\ApiDoc;
9use Symfony\Component\HttpKernel\Exception\HttpException;
10use Symfony\Component\HttpFoundation\Request;
11use Symfony\Component\HttpFoundation\JsonResponse; 9use Symfony\Component\HttpFoundation\JsonResponse;
10use Symfony\Component\HttpFoundation\Request;
11use Symfony\Component\HttpKernel\Exception\HttpException;
12use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 12use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
13use Wallabag\CoreBundle\Entity\Entry; 13use Wallabag\CoreBundle\Entity\Entry;
14use Wallabag\CoreBundle\Entity\Tag; 14use Wallabag\CoreBundle\Entity\Tag;
15use Wallabag\CoreBundle\Event\EntrySavedEvent;
16use Wallabag\CoreBundle\Event\EntryDeletedEvent; 15use Wallabag\CoreBundle\Event\EntryDeletedEvent;
16use Wallabag\CoreBundle\Event\EntrySavedEvent;
17 17
18class EntryRestController extends WallabagRestController 18class EntryRestController extends WallabagRestController
19{ 19{
@@ -59,7 +59,7 @@ class EntryRestController extends WallabagRestController
59 $url = $request->query->get('url', ''); 59 $url = $request->query->get('url', '');
60 60
61 if (empty($url)) { 61 if (empty($url)) {
62 throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId()); 62 throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId());
63 } 63 }
64 64
65 $res = $this->getDoctrine() 65 $res = $this->getDoctrine()
@@ -239,9 +239,9 @@ class EntryRestController extends WallabagRestController
239 * } 239 * }
240 * ) 240 * )
241 * 241 *
242 * @return JsonResponse
243 *
244 * @throws HttpException When limit is reached 242 * @throws HttpException When limit is reached
243 *
244 * @return JsonResponse
245 */ 245 */
246 public function postEntriesListAction(Request $request) 246 public function postEntriesListAction(Request $request)
247 { 247 {
@@ -678,11 +678,11 @@ class EntryRestController extends WallabagRestController
678 ]); 678 ]);
679 } 679 }
680 680
681 if (!is_null($isArchived)) { 681 if (null !== $isArchived) {
682 $entry->setArchived((bool) $isArchived); 682 $entry->setArchived((bool) $isArchived);
683 } 683 }
684 684
685 if (!is_null($isStarred)) { 685 if (null !== $isStarred) {
686 $entry->setStarred((bool) $isStarred); 686 $entry->setStarred((bool) $isStarred);
687 } 687 }
688 688
@@ -690,7 +690,7 @@ class EntryRestController extends WallabagRestController
690 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags); 690 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
691 } 691 }
692 692
693 if (!is_null($isPublic)) { 693 if (null !== $isPublic) {
694 if (true === (bool) $isPublic && null === $entry->getUid()) { 694 if (true === (bool) $isPublic && null === $entry->getUid()) {
695 $entry->generateUid(); 695 $entry->generateUid();
696 } elseif (false === (bool) $isPublic) { 696 } elseif (false === (bool) $isPublic) {