X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FController%2FWallabagAnnotationController.php;h=883ce4a89a3c039f7f91fec3405376bf54d963c7;hb=48b0163d247554d7e2f1ec63b717c8216ea9ec59;hp=2b4b0e8dd071245afde9e864fca0c119c14a455f;hpb=42708d1121fef12c84487247b170eb03083d5ffc;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 2b4b0e8d..883ce4a8 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -3,9 +3,9 @@ namespace Wallabag\AnnotationBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Wallabag\AnnotationBundle\Entity\Annotation; use Wallabag\AnnotationBundle\Form\EditAnnotationType; use Wallabag\AnnotationBundle\Form\NewAnnotationType; @@ -16,8 +16,6 @@ class WallabagAnnotationController extends FOSRestController /** * Retrieve annotations for an entry. * - * @param Entry $entry - * * @see Wallabag\ApiBundle\Controller\WallabagRestController * * @return JsonResponse @@ -28,10 +26,10 @@ class WallabagAnnotationController extends FOSRestController ->getDoctrine() ->getRepository('WallabagAnnotationBundle:Annotation') ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId()); - $total = count($annotationRows); + $total = \count($annotationRows); $annotations = ['total' => $total, 'rows' => $annotationRows]; - $json = $this->get('serializer')->serialize($annotations, 'json'); + $json = $this->get('jms_serializer')->serialize($annotations, 'json'); return (new JsonResponse())->setJson($json); } @@ -39,9 +37,6 @@ class WallabagAnnotationController extends FOSRestController /** * Creates a new annotation. * - * @param Request $request - * @param Entry $entry - * * @return JsonResponse * * @see Wallabag\ApiBundle\Controller\WallabagRestController @@ -64,7 +59,7 @@ class WallabagAnnotationController extends FOSRestController $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -79,9 +74,6 @@ class WallabagAnnotationController extends FOSRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * @param Request $request - * * @return JsonResponse */ public function putAnnotationAction(Annotation $annotation, Request $request) @@ -99,7 +91,7 @@ class WallabagAnnotationController extends FOSRestController $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -114,8 +106,6 @@ class WallabagAnnotationController extends FOSRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * * @return JsonResponse */ public function deleteAnnotationAction(Annotation $annotation) @@ -124,7 +114,7 @@ class WallabagAnnotationController extends FOSRestController $em->remove($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return (new JsonResponse())->setJson($json); }