X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FSearchRestController.php;fp=src%2FWallabag%2FApiBundle%2FController%2FSearchRestController.php;h=f8da0ad4a28a179512199a5bd8d5183d84266b88;hb=019e1acc4962229a538421b6f2b0643d03c1d72c;hp=6620107d36e76d8f774065c61b5515057cdeb412;hpb=9133bd02d11c37c98b2c7c979e363cc7bff8f914;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php index 6620107d..f8da0ad4 100644 --- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -4,7 +4,6 @@ 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; @@ -64,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); - } }