From 81577ef6b001b15d495ab46ab6eb6d479a7d5601 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 31 Dec 2023 09:34:04 +0100 Subject: [PATCH] Move Api entities to Core --- app/config/config.yml | 8 ++++---- src/Wallabag/ApiBundle/Form/Type/ClientType.php | 2 +- src/Wallabag/ApiBundle/Repository/ClientRepository.php | 2 +- .../CoreBundle/Controller/Api/DeveloperController.php | 2 +- .../CoreBundle/Controller/Api/UserRestController.php | 2 +- .../CoreBundle/Controller/Api/WallabagRestController.php | 2 +- .../Entity => CoreBundle/Entity/Api}/AccessToken.php | 4 ++-- .../Entity => CoreBundle/Entity/Api}/ApplicationInfo.php | 2 +- .../Entity => CoreBundle/Entity/Api}/AuthCode.php | 4 ++-- .../Entity => CoreBundle/Entity/Api}/Client.php | 6 +++--- .../Entity => CoreBundle/Entity/Api}/RefreshToken.php | 4 ++-- src/Wallabag/CoreBundle/Entity/User.php | 6 +++--- .../CoreBundle/Controller/Api/DeveloperControllerTest.php | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) rename src/Wallabag/{ApiBundle/Entity => CoreBundle/Entity/Api}/AccessToken.php (87%) rename src/Wallabag/{ApiBundle/Entity => CoreBundle/Entity/Api}/ApplicationInfo.php (95%) rename src/Wallabag/{ApiBundle/Entity => CoreBundle/Entity/Api}/AuthCode.php (89%) rename src/Wallabag/{ApiBundle/Entity => CoreBundle/Entity/Api}/Client.php (89%) rename src/Wallabag/{ApiBundle/Entity => CoreBundle/Entity/Api}/RefreshToken.php (87%) diff --git a/app/config/config.yml b/app/config/config.yml index e465a013f..a53562f7d 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -172,10 +172,10 @@ fos_user: fos_oauth_server: db_driver: orm - client_class: Wallabag\ApiBundle\Entity\Client - access_token_class: Wallabag\ApiBundle\Entity\AccessToken - refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken - auth_code_class: Wallabag\ApiBundle\Entity\AuthCode + client_class: Wallabag\CoreBundle\Entity\Api\Client + access_token_class: Wallabag\CoreBundle\Entity\Api\AccessToken + refresh_token_class: Wallabag\CoreBundle\Entity\Api\RefreshToken + auth_code_class: Wallabag\CoreBundle\Entity\Api\AuthCode service: user_provider: fos_user.user_provider.username_email options: diff --git a/src/Wallabag/ApiBundle/Form/Type/ClientType.php b/src/Wallabag/ApiBundle/Form/Type/ClientType.php index 3d00b2ac8..b45127ae9 100644 --- a/src/Wallabag/ApiBundle/Form/Type/ClientType.php +++ b/src/Wallabag/ApiBundle/Form/Type/ClientType.php @@ -9,7 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Wallabag\ApiBundle\Entity\Client; +use Wallabag\CoreBundle\Entity\Api\Client; class ClientType extends AbstractType { diff --git a/src/Wallabag/ApiBundle/Repository/ClientRepository.php b/src/Wallabag/ApiBundle/Repository/ClientRepository.php index 0c0b79786..ab9325836 100644 --- a/src/Wallabag/ApiBundle/Repository/ClientRepository.php +++ b/src/Wallabag/ApiBundle/Repository/ClientRepository.php @@ -4,7 +4,7 @@ namespace Wallabag\ApiBundle\Repository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -use Wallabag\ApiBundle\Entity\Client; +use Wallabag\CoreBundle\Entity\Api\Client; /** * @method Client[] findByUser(int $userId) diff --git a/src/Wallabag/CoreBundle/Controller/Api/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/Api/DeveloperController.php index afad4bce0..1bc665763 100644 --- a/src/Wallabag/CoreBundle/Controller/Api/DeveloperController.php +++ b/src/Wallabag/CoreBundle/Controller/Api/DeveloperController.php @@ -8,10 +8,10 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; -use Wallabag\ApiBundle\Entity\Client; use Wallabag\ApiBundle\Form\Type\ClientType; use Wallabag\ApiBundle\Repository\ClientRepository; use Wallabag\CoreBundle\Controller\AbstractController; +use Wallabag\CoreBundle\Entity\Api\Client; class DeveloperController extends AbstractController { diff --git a/src/Wallabag/CoreBundle/Controller/Api/UserRestController.php b/src/Wallabag/CoreBundle/Controller/Api/UserRestController.php index 6a33b7c8b..8d59b0949 100644 --- a/src/Wallabag/CoreBundle/Controller/Api/UserRestController.php +++ b/src/Wallabag/CoreBundle/Controller/Api/UserRestController.php @@ -15,7 +15,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; -use Wallabag\ApiBundle\Entity\Client; +use Wallabag\CoreBundle\Entity\Api\Client; use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Form\Type\NewUserType; diff --git a/src/Wallabag/CoreBundle/Controller/Api/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/Api/WallabagRestController.php index 68339e5d1..094a7ec75 100644 --- a/src/Wallabag/CoreBundle/Controller/Api/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/Api/WallabagRestController.php @@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Contracts\Translation\TranslatorInterface; -use Wallabag\ApiBundle\Entity\ApplicationInfo; +use Wallabag\CoreBundle\Entity\Api\ApplicationInfo; use Wallabag\CoreBundle\Entity\User; class WallabagRestController extends AbstractFOSRestController diff --git a/src/Wallabag/ApiBundle/Entity/AccessToken.php b/src/Wallabag/CoreBundle/Entity/Api/AccessToken.php similarity index 87% rename from src/Wallabag/ApiBundle/Entity/AccessToken.php rename to src/Wallabag/CoreBundle/Entity/Api/AccessToken.php index 29f81ccaf..564f95db5 100644 --- a/src/Wallabag/ApiBundle/Entity/AccessToken.php +++ b/src/Wallabag/CoreBundle/Entity/Api/AccessToken.php @@ -1,6 +1,6 @@ + * @var ArrayCollection&iterable<\Wallabag\CoreBundle\Entity\Api\Client> * - * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) + * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\Api\Client", mappedBy="user", cascade={"remove"}) */ protected $clients; diff --git a/tests/Wallabag/CoreBundle/Controller/Api/DeveloperControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Api/DeveloperControllerTest.php index b98ae6e43..d96a20ca3 100644 --- a/tests/Wallabag/CoreBundle/Controller/Api/DeveloperControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Api/DeveloperControllerTest.php @@ -4,7 +4,7 @@ namespace Tests\Wallabag\CoreBundle\Controller\Api; use Doctrine\ORM\EntityManagerInterface; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\ApiBundle\Entity\Client; +use Wallabag\CoreBundle\Entity\Api\Client; class DeveloperControllerTest extends WallabagCoreTestCase {