aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-10-11 09:55:03 +0200
committerGitHub <noreply@github.com>2017-10-11 09:55:03 +0200
commitd8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862 (patch)
tree3f7ea5ce149b98d01a32f45c2d5be43fbf8ea21c /src/Wallabag/ApiBundle/Controller
parent21bdbb2d5e8ef1a93a51bc6d55e041f95820b4ba (diff)
parentf645d371ce55e9c2a45712df34244318742b0d74 (diff)
downloadwallabag-d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862.tar.gz
wallabag-d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862.tar.zst
wallabag-d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862.zip
Merge pull request #3376 from wallabag/symfony-3.3
Symfony 3.3
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php2
-rw-r--r--src/Wallabag/ApiBundle/Controller/TagRestController.php10
-rw-r--r--src/Wallabag/ApiBundle/Controller/UserRestController.php6
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php2
4 files changed, 10 insertions, 10 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 6db97731..86e72335 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -752,7 +752,7 @@ class EntryRestController extends WallabagRestController
752 $context = new SerializationContext(); 752 $context = new SerializationContext();
753 $context->setSerializeNull(true); 753 $context->setSerializeNull(true);
754 754
755 $json = $this->get('serializer')->serialize($data, 'json', $context); 755 $json = $this->get('jms_serializer')->serialize($data, 'json', $context);
756 756
757 return (new JsonResponse())->setJson($json); 757 return (new JsonResponse())->setJson($json);
758 } 758 }
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php
index efa4e8cf..9d333fe4 100644
--- a/src/Wallabag/ApiBundle/Controller/TagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php
@@ -25,7 +25,7 @@ class TagRestController extends WallabagRestController
25 ->getRepository('WallabagCoreBundle:Tag') 25 ->getRepository('WallabagCoreBundle:Tag')
26 ->findAllTags($this->getUser()->getId()); 26 ->findAllTags($this->getUser()->getId());
27 27
28 $json = $this->get('serializer')->serialize($tags, 'json'); 28 $json = $this->get('jms_serializer')->serialize($tags, 'json');
29 29
30 return (new JsonResponse())->setJson($json); 30 return (new JsonResponse())->setJson($json);
31 } 31 }
@@ -58,7 +58,7 @@ class TagRestController extends WallabagRestController
58 58
59 $this->cleanOrphanTag($tag); 59 $this->cleanOrphanTag($tag);
60 60
61 $json = $this->get('serializer')->serialize($tag, 'json'); 61 $json = $this->get('jms_serializer')->serialize($tag, 'json');
62 62
63 return (new JsonResponse())->setJson($json); 63 return (new JsonResponse())->setJson($json);
64 } 64 }
@@ -100,7 +100,7 @@ class TagRestController extends WallabagRestController
100 100
101 $this->cleanOrphanTag($tags); 101 $this->cleanOrphanTag($tags);
102 102
103 $json = $this->get('serializer')->serialize($tags, 'json'); 103 $json = $this->get('jms_serializer')->serialize($tags, 'json');
104 104
105 return (new JsonResponse())->setJson($json); 105 return (new JsonResponse())->setJson($json);
106 } 106 }
@@ -126,7 +126,7 @@ class TagRestController extends WallabagRestController
126 126
127 $this->cleanOrphanTag($tag); 127 $this->cleanOrphanTag($tag);
128 128
129 $json = $this->get('serializer')->serialize($tag, 'json'); 129 $json = $this->get('jms_serializer')->serialize($tag, 'json');
130 130
131 return (new JsonResponse())->setJson($json); 131 return (new JsonResponse())->setJson($json);
132 } 132 }
@@ -145,7 +145,7 @@ class TagRestController extends WallabagRestController
145 $em = $this->getDoctrine()->getManager(); 145 $em = $this->getDoctrine()->getManager();
146 146
147 foreach ($tags as $tag) { 147 foreach ($tags as $tag) {
148 if (count($tag->getEntries()) === 0) { 148 if (0 === count($tag->getEntries())) {
149 $em->remove($tag); 149 $em->remove($tag);
150 } 150 }
151 } 151 }
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php
index 6f47cff0..a1378fc5 100644
--- a/src/Wallabag/ApiBundle/Controller/UserRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php
@@ -46,7 +46,7 @@ class UserRestController extends WallabagRestController
46 public function putUserAction(Request $request) 46 public function putUserAction(Request $request)
47 { 47 {
48 if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { 48 if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
49 $json = $this->get('serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); 49 $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json');
50 50
51 return (new JsonResponse()) 51 return (new JsonResponse())
52 ->setJson($json) 52 ->setJson($json)
@@ -92,7 +92,7 @@ class UserRestController extends WallabagRestController
92 $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']); 92 $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']);
93 } 93 }
94 94
95 $json = $this->get('serializer')->serialize(['error' => $errors], 'json'); 95 $json = $this->get('jms_serializer')->serialize(['error' => $errors], 'json');
96 96
97 return (new JsonResponse()) 97 return (new JsonResponse())
98 ->setJson($json) 98 ->setJson($json)
@@ -127,7 +127,7 @@ class UserRestController extends WallabagRestController
127 */ 127 */
128 private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK) 128 private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK)
129 { 129 {
130 $json = $this->get('serializer')->serialize( 130 $json = $this->get('jms_serializer')->serialize(
131 $user, 131 $user,
132 'json', 132 'json',
133 SerializationContext::create()->setGroups([$group]) 133 SerializationContext::create()->setGroups([$group])
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 71da2a64..7d8cfbba 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -19,7 +19,7 @@ class WallabagRestController extends FOSRestController
19 public function getVersionAction() 19 public function getVersionAction()
20 { 20 {
21 $version = $this->container->getParameter('wallabag_core.version'); 21 $version = $this->container->getParameter('wallabag_core.version');
22 $json = $this->get('serializer')->serialize($version, 'json'); 22 $json = $this->get('jms_serializer')->serialize($version, 'json');
23 23
24 return (new JsonResponse())->setJson($json); 24 return (new JsonResponse())->setJson($json);
25 } 25 }