]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
bring annotations to API
[github/wallabag/wallabag.git] / src / Wallabag / AnnotationBundle / Controller / WallabagAnnotationController.php
index 5f981eb58522f200633257fe04aa0165b98b901f..80ac0035580ab2884aabf9688b4f21acf90d6753 100644 (file)
@@ -15,11 +15,9 @@ class WallabagAnnotationController extends FOSRestController
     /**
      * Retrieve annotations for an entry.
      *
-     * @ApiDoc(
-     *      requirements={
-     *          {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
-     *      }
-     * )
+     * @param Entry $entry
+     *
+     * @see Wallabag\ApiBundle\Controller\WallabagRestController
      *
      * @return Response
      */
@@ -30,7 +28,7 @@ class WallabagAnnotationController extends FOSRestController
                 ->getRepository('WallabagAnnotationBundle:Annotation')
                 ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
         $total = count($annotationRows);
-        $annotations = array('total' => $total, 'rows' => $annotationRows);
+        $annotations = ['total' => $total, 'rows' => $annotationRows];
 
         $json = $this->get('serializer')->serialize($annotations, 'json');
 
@@ -42,13 +40,7 @@ class WallabagAnnotationController extends FOSRestController
      *
      * @param Entry $entry
      *
-     * @ApiDoc(
-     *      requirements={
-     *          {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"},
-     *          {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the annotation"},
-     *          {"name"="text", "dataType"="string", "required"=true, "description"=""},
-     *      }
-     * )
+     * @see Wallabag\ApiBundle\Controller\WallabagRestController
      *
      * @return Response
      */
@@ -81,11 +73,7 @@ class WallabagAnnotationController extends FOSRestController
     /**
      * Updates an annotation.
      *
-     * @ApiDoc(
-     *      requirements={
-     *          {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"}
-     *      }
-     * )
+     * @see Wallabag\ApiBundle\Controller\WallabagRestController
      *
      * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
      *
@@ -110,11 +98,7 @@ class WallabagAnnotationController extends FOSRestController
     /**
      * Removes an annotation.
      *
-     * @ApiDoc(
-     *      requirements={
-     *          {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"}
-     *      }
-     * )
+     * @see Wallabag\ApiBundle\Controller\WallabagRestController
      *
      * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
      *
@@ -141,6 +125,6 @@ class WallabagAnnotationController extends FOSRestController
      */
     private function renderJsonResponse($json, $code = 200)
     {
-        return new Response($json, $code, array('application/json'));
+        return new Response($json, $code, ['application/json']);
     }
 }