]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix some Scrutinizer issues 3986/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 29 May 2019 10:00:23 +0000 (12:00 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 29 May 2019 10:50:44 +0000 (12:50 +0200)
src/Wallabag/ApiBundle/Controller/EntryRestController.php
src/Wallabag/ApiBundle/Controller/UserRestController.php
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Entity/Entry.php
src/Wallabag/CoreBundle/Repository/EntryRepository.php

index aaacdcdc9206cf9baeddbad79059eb7c9f78a99a..9f933adb7cef298ef90f43ccabfc09f1471ddaef 100644 (file)
@@ -564,7 +564,7 @@ class EntryRestController extends WallabagRestController
         }
 
         // if refreshing entry failed, don't save it
-        if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) {
+        if ($this->container->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) {
             return new JsonResponse([], 304);
         }
 
index 3a4dafcd083887e92923e0e23f30adef50292834..1b10a076da87f56d24163154d3b979e4595bbfb2 100644 (file)
@@ -45,7 +45,7 @@ class UserRestController extends WallabagRestController
      */
     public function putUserAction(Request $request)
     {
-        if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
+        if (!$this->container->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
             $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json');
 
             return (new JsonResponse())
index f18b0910d9d05120b5eeee9ec108ed41190ac5a3..44fd968354120ced54c33ae4dd2e4a5d470df35f 100644 (file)
@@ -2,13 +2,13 @@
 
 namespace Wallabag\ApiBundle\Controller;
 
-use FOS\RestBundle\Controller\FOSRestController;
+use FOS\RestBundle\Controller\AbstractFOSRestController;
 use JMS\Serializer\SerializationContext;
 use Nelmio\ApiDocBundle\Annotation\ApiDoc;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\Security\Core\Exception\AccessDeniedException;
 
-class WallabagRestController extends FOSRestController
+class WallabagRestController extends AbstractFOSRestController
 {
     /**
      * Retrieve version number.
index 1b4367fd79d6feee50a98a43758f4bd0d2500a9d..8637c62f0e40b2c7684c98551add52646d6e1995 100644 (file)
@@ -771,7 +771,7 @@ class Entry
     }
 
     /**
-     * @return string
+     * @return string|null
      */
     public function getUid()
     {
index 880e7c65aa0a0e0b8aa2007171f76feadae219c3..f9cf5233f01b8296389339adbea179ab48278588 100644 (file)
@@ -345,7 +345,7 @@ class EntryRepository extends EntityRepository
      * @param string $url
      * @param int    $userId
      *
-     * @return Entry|bool
+     * @return Entry|false
      */
     public function findByUrlAndUserId($url, $userId)
     {
@@ -362,7 +362,7 @@ class EntryRepository extends EntityRepository
      * @param string $hashedUrl Url hashed using sha1
      * @param int    $userId
      *
-     * @return Entry|bool
+     * @return Entry|false
      */
     public function findByHashedUrlAndUserId($hashedUrl, $userId)
     {