X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FSearchRestController.php;h=f8da0ad4a28a179512199a5bd8d5183d84266b88;hb=019e1acc4962229a538421b6f2b0643d03c1d72c;hp=c0b2cb24c4a2421e8a9c7f70885e81469df456d2;hpb=b32057980e33e7ddd93480017496a589006b8260;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php index c0b2cb24..f8da0ad4 100644 --- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -4,19 +4,12 @@ namespace Wallabag\ApiBundle\Controller; use Hateoas\Configuration\Route; use Hateoas\Representation\Factory\PagerfantaFactory; -use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\CoreBundle\Entity\Tag; -use Wallabag\CoreBundle\Event\EntryDeletedEvent; -use Wallabag\CoreBundle\Event\EntrySavedEvent; class SearchRestController extends WallabagRestController { @@ -70,22 +63,4 @@ class SearchRestController extends WallabagRestController return $this->sendResponse($paginatedCollection); } - - /** - * Shortcut to send data serialized in json. - * - * @param mixed $data - * - * @return JsonResponse - */ - private function sendResponse($data) - { - // https://github.com/schmittjoh/JMSSerializerBundle/issues/293 - $context = new SerializationContext(); - $context->setSerializeNull(true); - - $json = $this->get('jms_serializer')->serialize($data, 'json', $context); - - return (new JsonResponse())->setJson($json); - } }