]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/TagRestController.php
php-cs-fixer
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / TagRestController.php
index efa4e8cfc1ea5b072121078c8532a970e54485e0..c6d6df6a91423718f5006cbace9f569eca6e7a7c 100644 (file)
@@ -25,7 +25,7 @@ class TagRestController extends WallabagRestController
             ->getRepository('WallabagCoreBundle:Tag')
             ->findAllTags($this->getUser()->getId());
 
-        $json = $this->get('serializer')->serialize($tags, 'json');
+        $json = $this->get('jms_serializer')->serialize($tags, 'json');
 
         return (new JsonResponse())->setJson($json);
     }
@@ -58,7 +58,7 @@ class TagRestController extends WallabagRestController
 
         $this->cleanOrphanTag($tag);
 
-        $json = $this->get('serializer')->serialize($tag, 'json');
+        $json = $this->get('jms_serializer')->serialize($tag, 'json');
 
         return (new JsonResponse())->setJson($json);
     }
@@ -100,7 +100,7 @@ class TagRestController extends WallabagRestController
 
         $this->cleanOrphanTag($tags);
 
-        $json = $this->get('serializer')->serialize($tags, 'json');
+        $json = $this->get('jms_serializer')->serialize($tags, 'json');
 
         return (new JsonResponse())->setJson($json);
     }
@@ -126,7 +126,7 @@ class TagRestController extends WallabagRestController
 
         $this->cleanOrphanTag($tag);
 
-        $json = $this->get('serializer')->serialize($tag, 'json');
+        $json = $this->get('jms_serializer')->serialize($tag, 'json');
 
         return (new JsonResponse())->setJson($json);
     }
@@ -138,14 +138,14 @@ class TagRestController extends WallabagRestController
      */
     private function cleanOrphanTag($tags)
     {
-        if (!is_array($tags)) {
+        if (!\is_array($tags)) {
             $tags = [$tags];
         }
 
         $em = $this->getDoctrine()->getManager();
 
         foreach ($tags as $tag) {
-            if (count($tag->getEntries()) === 0) {
+            if (0 === \count($tag->getEntries())) {
                 $em->remove($tag);
             }
         }