From 3fc0b5fa5b4ba7e266612e0be97bc68cc613d862 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 31 Dec 2023 09:28:37 +0100 Subject: [PATCH] Move Api controllers to Core --- app/config/routing.yml | 5 ----- app/config/services.yml | 4 ---- .../CoreBundle/Controller/AnnotationController.php | 8 ++++---- .../Controller/Api}/AnnotationRestController.php | 2 +- .../Controller/Api}/ConfigRestController.php | 2 +- .../Controller/Api}/DeveloperController.php | 2 +- .../Controller/Api}/EntryRestController.php | 2 +- .../Controller/Api}/SearchRestController.php | 2 +- .../Controller/Api}/TagRestController.php | 2 +- .../Controller/Api}/TaggingRuleRestController.php | 2 +- .../Controller/Api}/UserRestController.php | 2 +- .../Controller/Api}/WallabagRestController.php | 2 +- .../Controller/Api}/ConfigRestControllerTest.php | 4 +--- .../Controller/Api}/DeveloperControllerTest.php | 2 +- .../Controller/Api}/EntryRestControllerTest.php | 3 +-- .../Controller/Api}/SearchRestControllerTest.php | 4 +--- .../Controller/Api}/TagRestControllerTest.php | 3 +-- .../Controller/Api}/TaggingRuleRestControllerTest.php | 4 +--- .../Controller/Api}/UserRestControllerTest.php | 3 +-- .../Controller/Api}/WallabagApiTestCase.php | 2 +- .../Controller/Api}/WallabagRestControllerTest.php | 3 +-- 21 files changed, 22 insertions(+), 41 deletions(-) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/AnnotationRestController.php (99%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/ConfigRestController.php (96%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/DeveloperController.php (98%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/EntryRestController.php (99%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/SearchRestController.php (98%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/TagRestController.php (99%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/TaggingRuleRestController.php (97%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/UserRestController.php (99%) rename src/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/WallabagRestController.php (99%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/ConfigRestControllerTest.php (94%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/DeveloperControllerTest.php (98%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/EntryRestControllerTest.php (99%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/SearchRestControllerTest.php (96%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/TagRestControllerTest.php (98%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/TaggingRuleRestControllerTest.php (79%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/UserRestControllerTest.php (98%) rename tests/Wallabag/{ApiBundle => CoreBundle/Controller/Api}/WallabagApiTestCase.php (97%) rename tests/Wallabag/{ApiBundle/Controller => CoreBundle/Controller/Api}/WallabagRestControllerTest.php (95%) diff --git a/app/config/routing.yml b/app/config/routing.yml index 205fe8230..ec57effa2 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -3,11 +3,6 @@ wallabag_import: type: annotation prefix: /import -wallabag_api: - resource: "@WallabagApiBundle/Controller/" - type: annotation - prefix: / - app: resource: "@WallabagCoreBundle/Controller/" type: annotation diff --git a/app/config/services.yml b/app/config/services.yml index 3549e5def..14bfa3123 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -42,10 +42,6 @@ services: # controllers are imported separately to make sure services can be injected # as action arguments even if you don't extend any base controller class - Wallabag\ApiBundle\Controller\: - resource: '../../src/Wallabag/ApiBundle/Controller/' - tags: ['controller.service_arguments'] - Wallabag\CoreBundle\Controller\: resource: '../../src/Wallabag/CoreBundle/Controller/' tags: ['controller.service_arguments'] diff --git a/src/Wallabag/CoreBundle/Controller/AnnotationController.php b/src/Wallabag/CoreBundle/Controller/AnnotationController.php index fa7cc218a..aa48ac095 100644 --- a/src/Wallabag/CoreBundle/Controller/AnnotationController.php +++ b/src/Wallabag/CoreBundle/Controller/AnnotationController.php @@ -33,7 +33,7 @@ class AnnotationController extends AbstractFOSRestController /** * Retrieve annotations for an entry. * - * @see Wallabag\ApiBundle\Controller\WallabagRestController + * @see Api\WallabagRestController * * @Route("/annotations/{entry}.{_format}", methods={"GET"}, name="annotations_get_annotations", defaults={"_format": "json"}) * @@ -54,7 +54,7 @@ class AnnotationController extends AbstractFOSRestController /** * Creates a new annotation. * - * @see Wallabag\ApiBundle\Controller\WallabagRestController + * @see Api\WallabagRestController * * @Route("/annotations/{entry}.{_format}", methods={"POST"}, name="annotations_post_annotation", defaults={"_format": "json"}) * @@ -88,7 +88,7 @@ class AnnotationController extends AbstractFOSRestController /** * Updates an annotation. * - * @see Wallabag\ApiBundle\Controller\WallabagRestController + * @see Api\WallabagRestController * * @Route("/annotations/{annotation}.{_format}", methods={"PUT"}, name="annotations_put_annotation", defaults={"_format": "json"}) * @@ -125,7 +125,7 @@ class AnnotationController extends AbstractFOSRestController /** * Removes an annotation. * - * @see Wallabag\ApiBundle\Controller\WallabagRestController + * @see Api\WallabagRestController * * @Route("/annotations/{annotation}.{_format}", methods={"DELETE"}, name="annotations_delete_annotation", defaults={"_format": "json"}) * diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/CoreBundle/Controller/Api/AnnotationRestController.php similarity index 99% rename from src/Wallabag/ApiBundle/Controller/AnnotationRestController.php rename to src/Wallabag/CoreBundle/Controller/Api/AnnotationRestController.php index 63a3857e5..6fe11bcc9 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/CoreBundle/Controller/Api/AnnotationRestController.php @@ -1,6 +1,6 @@