X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FController%2FWallabagAnnotationController.php;h=4143c1b6c37beb9cda950f334b416572532d05fe;hb=c7935f32d2cd7fd29dbc7b07c8f206f6e8b64fb4;hp=5f981eb58522f200633257fe04aa0165b98b901f;hpb=4dc872238a61f33c886c423c5812cc578b3b1cdc;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 5f981eb5..4143c1b6 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -3,7 +3,6 @@ namespace Wallabag\AnnotationBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; -use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; @@ -15,11 +14,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 +27,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 +39,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 +72,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 +97,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 +124,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']); } }