1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-06 17:41:01 +00:00

Use FQCN instead of service alias

This commit is contained in:
Yassine Guedidi 2022-08-28 02:01:46 +02:00
parent 156158673f
commit eb43c78720
62 changed files with 579 additions and 404 deletions

View file

@ -3,7 +3,9 @@
namespace Wallabag\AnnotationBundle\Controller;
use FOS\RestBundle\Controller\AbstractFOSRestController;
use JMS\Serializer\SerializerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Wallabag\AnnotationBundle\Entity\Annotation;
@ -29,7 +31,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
$total = \count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];
$json = $this->get('jms_serializer')->serialize($annotations, 'json');
$json = $this->get(SerializerInterface::class)->serialize($annotations, 'json');
return (new JsonResponse())->setJson($json);
}
@ -49,7 +51,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
$annotation = new Annotation($this->getUser());
$annotation->setEntry($entry);
$form = $this->get('form.factory')->createNamed('', NewAnnotationType::class, $annotation, [
$form = $this->get(FormFactoryInterface::class)->createNamed('', NewAnnotationType::class, $annotation, [
'csrf_protection' => false,
'allow_extra_fields' => true,
]);
@ -59,7 +61,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
$em->persist($annotation);
$em->flush();
$json = $this->get('jms_serializer')->serialize($annotation, 'json');
$json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
@ -80,7 +82,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
{
$data = json_decode($request->getContent(), true);
$form = $this->get('form.factory')->createNamed('', EditAnnotationType::class, $annotation, [
$form = $this->get(FormFactoryInterface::class)->createNamed('', EditAnnotationType::class, $annotation, [
'csrf_protection' => false,
'allow_extra_fields' => true,
]);
@ -91,7 +93,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
$em->persist($annotation);
$em->flush();
$json = $this->get('jms_serializer')->serialize($annotation, 'json');
$json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
@ -114,7 +116,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
$em->remove($annotation);
$em->flush();
$json = $this->get('jms_serializer')->serialize($annotation, 'json');
$json = $this->get(SerializerInterface::class)->serialize($annotation, 'json');
return (new JsonResponse())->setJson($json);
}