From 52e8d93248c6f47ccb98abc973fcd230b29fee6c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 29 May 2019 12:00:23 +0200 Subject: Fix some Scrutinizer issues --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 2 +- src/Wallabag/ApiBundle/Controller/UserRestController.php | 2 +- src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 ++-- src/Wallabag/CoreBundle/Entity/Entry.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index aaacdcdc..9f933adb 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -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); } diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 3a4dafcd..1b10a076 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php @@ -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()) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index f18b0910..44fd9683 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -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. diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 1b4367fd..8637c62f 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -771,7 +771,7 @@ class Entry } /** - * @return string + * @return string|null */ public function getUid() { diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 880e7c65..f9cf5233 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -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) { -- cgit v1.2.3