From d2aa6d0dbb7857e8c25e56905cfca1051d9d485d Mon Sep 17 00:00:00 2001 From: mamazu Date: Wed, 12 Dec 2018 17:41:48 +0100 Subject: [PATCH 1/4] Splitting up the view respositories --- src/Resources/config/services/queries.xml | 51 ++----------------- .../config/services/repositories/cart.xml | 11 ++++ .../config/services/repositories/order.xml | 12 +++++ .../config/services/repositories/product.xml | 41 +++++++++++++++ .../{ => Cart}/CartViewRepository.php | 2 +- .../CartViewRepositoryInterface.php | 2 +- .../{ => Order}/PlacedOrderViewRepository.php | 2 +- .../PlacedOrderViewRepositoryInterface.php | 2 +- .../ProductCatalogViewRepository.php | 2 +- .../ProductCatalogViewRepositoryInterface.php | 2 +- .../ProductDetailsViewRepository.php | 2 +- .../ProductDetailsViewRepositoryInterface.php | 2 +- .../ProductLatestViewRepository.php | 2 +- .../ProductLatestViewRepositoryInterface.php | 2 +- .../ProductReviewsViewRepository.php | 2 +- .../ProductReviewsViewRepositoryInterface.php | 2 +- 16 files changed, 81 insertions(+), 58 deletions(-) create mode 100644 src/Resources/config/services/repositories/cart.xml create mode 100644 src/Resources/config/services/repositories/order.xml create mode 100644 src/Resources/config/services/repositories/product.xml rename src/ViewRepository/{ => Cart}/CartViewRepository.php (95%) rename src/ViewRepository/{ => Cart}/CartViewRepositoryInterface.php (79%) rename src/ViewRepository/{ => Order}/PlacedOrderViewRepository.php (98%) rename src/ViewRepository/{ => Order}/PlacedOrderViewRepositoryInterface.php (87%) rename src/ViewRepository/{ => Product}/ProductCatalogViewRepository.php (98%) rename src/ViewRepository/{ => Product}/ProductCatalogViewRepositoryInterface.php (89%) rename src/ViewRepository/{ => Product}/ProductDetailsViewRepository.php (98%) rename src/ViewRepository/{ => Product}/ProductDetailsViewRepositoryInterface.php (86%) rename src/ViewRepository/{ => Product}/ProductLatestViewRepository.php (97%) rename src/ViewRepository/{ => Product}/ProductLatestViewRepositoryInterface.php (81%) rename src/ViewRepository/{ => Product}/ProductReviewsViewRepository.php (98%) rename src/ViewRepository/{ => Product}/ProductReviewsViewRepositoryInterface.php (89%) diff --git a/src/Resources/config/services/queries.xml b/src/Resources/config/services/queries.xml index 2c9c44ab0..59b866e70 100644 --- a/src/Resources/config/services/queries.xml +++ b/src/Resources/config/services/queries.xml @@ -1,50 +1,9 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Resources/config/services/repositories/cart.xml b/src/Resources/config/services/repositories/cart.xml new file mode 100644 index 000000000..f52e314b9 --- /dev/null +++ b/src/Resources/config/services/repositories/cart.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/src/Resources/config/services/repositories/order.xml b/src/Resources/config/services/repositories/order.xml new file mode 100644 index 000000000..3e0dddb73 --- /dev/null +++ b/src/Resources/config/services/repositories/order.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/src/Resources/config/services/repositories/product.xml b/src/Resources/config/services/repositories/product.xml new file mode 100644 index 000000000..25173c319 --- /dev/null +++ b/src/Resources/config/services/repositories/product.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ViewRepository/CartViewRepository.php b/src/ViewRepository/Cart/CartViewRepository.php similarity index 95% rename from src/ViewRepository/CartViewRepository.php rename to src/ViewRepository/Cart/CartViewRepository.php index 13b2bc8ed..fb1d454b8 100644 --- a/src/ViewRepository/CartViewRepository.php +++ b/src/ViewRepository/Cart/CartViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Cart; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Repository\OrderRepositoryInterface; diff --git a/src/ViewRepository/CartViewRepositoryInterface.php b/src/ViewRepository/Cart/CartViewRepositoryInterface.php similarity index 79% rename from src/ViewRepository/CartViewRepositoryInterface.php rename to src/ViewRepository/Cart/CartViewRepositoryInterface.php index 3f2ece375..58796f572 100644 --- a/src/ViewRepository/CartViewRepositoryInterface.php +++ b/src/ViewRepository/Cart/CartViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Cart; use Sylius\ShopApiPlugin\View\CartSummaryView; diff --git a/src/ViewRepository/PlacedOrderViewRepository.php b/src/ViewRepository/Order/PlacedOrderViewRepository.php similarity index 98% rename from src/ViewRepository/PlacedOrderViewRepository.php rename to src/ViewRepository/Order/PlacedOrderViewRepository.php index 69d0b464e..db0e45dd6 100644 --- a/src/ViewRepository/PlacedOrderViewRepository.php +++ b/src/ViewRepository/Order/PlacedOrderViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Order; use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Core\Model\OrderInterface; diff --git a/src/ViewRepository/PlacedOrderViewRepositoryInterface.php b/src/ViewRepository/Order/PlacedOrderViewRepositoryInterface.php similarity index 87% rename from src/ViewRepository/PlacedOrderViewRepositoryInterface.php rename to src/ViewRepository/Order/PlacedOrderViewRepositoryInterface.php index 05d857ce7..674822df2 100644 --- a/src/ViewRepository/PlacedOrderViewRepositoryInterface.php +++ b/src/ViewRepository/Order/PlacedOrderViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Order; use Sylius\ShopApiPlugin\View\PlacedOrderView; diff --git a/src/ViewRepository/ProductCatalogViewRepository.php b/src/ViewRepository/Product/ProductCatalogViewRepository.php similarity index 98% rename from src/ViewRepository/ProductCatalogViewRepository.php rename to src/ViewRepository/Product/ProductCatalogViewRepository.php index a22f7e774..f39e70df7 100644 --- a/src/ViewRepository/ProductCatalogViewRepository.php +++ b/src/ViewRepository/Product/ProductCatalogViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; diff --git a/src/ViewRepository/ProductCatalogViewRepositoryInterface.php b/src/ViewRepository/Product/ProductCatalogViewRepositoryInterface.php similarity index 89% rename from src/ViewRepository/ProductCatalogViewRepositoryInterface.php rename to src/ViewRepository/Product/ProductCatalogViewRepositoryInterface.php index 130f608d1..e1b3e2be5 100644 --- a/src/ViewRepository/ProductCatalogViewRepositoryInterface.php +++ b/src/ViewRepository/Product/ProductCatalogViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\View\PageView; diff --git a/src/ViewRepository/ProductDetailsViewRepository.php b/src/ViewRepository/Product/ProductDetailsViewRepository.php similarity index 98% rename from src/ViewRepository/ProductDetailsViewRepository.php rename to src/ViewRepository/Product/ProductDetailsViewRepository.php index cc4b13189..d2fe8cc55 100644 --- a/src/ViewRepository/ProductDetailsViewRepository.php +++ b/src/ViewRepository/Product/ProductDetailsViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Model\ChannelInterface; diff --git a/src/ViewRepository/ProductDetailsViewRepositoryInterface.php b/src/ViewRepository/Product/ProductDetailsViewRepositoryInterface.php similarity index 86% rename from src/ViewRepository/ProductDetailsViewRepositoryInterface.php rename to src/ViewRepository/Product/ProductDetailsViewRepositoryInterface.php index fa090cb6e..25b6a0877 100644 --- a/src/ViewRepository/ProductDetailsViewRepositoryInterface.php +++ b/src/ViewRepository/Product/ProductDetailsViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\ShopApiPlugin\View\ProductView; diff --git a/src/ViewRepository/ProductLatestViewRepository.php b/src/ViewRepository/Product/ProductLatestViewRepository.php similarity index 97% rename from src/ViewRepository/ProductLatestViewRepository.php rename to src/ViewRepository/Product/ProductLatestViewRepository.php index ffc190276..dc359d537 100644 --- a/src/ViewRepository/ProductLatestViewRepository.php +++ b/src/ViewRepository/Product/ProductLatestViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Model\ChannelInterface; diff --git a/src/ViewRepository/ProductLatestViewRepositoryInterface.php b/src/ViewRepository/Product/ProductLatestViewRepositoryInterface.php similarity index 81% rename from src/ViewRepository/ProductLatestViewRepositoryInterface.php rename to src/ViewRepository/Product/ProductLatestViewRepositoryInterface.php index dd04f37de..d0bc765aa 100644 --- a/src/ViewRepository/ProductLatestViewRepositoryInterface.php +++ b/src/ViewRepository/Product/ProductLatestViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\ShopApiPlugin\View\ProductListView; diff --git a/src/ViewRepository/ProductReviewsViewRepository.php b/src/ViewRepository/Product/ProductReviewsViewRepository.php similarity index 98% rename from src/ViewRepository/ProductReviewsViewRepository.php rename to src/ViewRepository/Product/ProductReviewsViewRepository.php index c8be2f0fb..d904eb0cc 100644 --- a/src/ViewRepository/ProductReviewsViewRepository.php +++ b/src/ViewRepository/Product/ProductReviewsViewRepository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Pagerfanta; diff --git a/src/ViewRepository/ProductReviewsViewRepositoryInterface.php b/src/ViewRepository/Product/ProductReviewsViewRepositoryInterface.php similarity index 89% rename from src/ViewRepository/ProductReviewsViewRepositoryInterface.php rename to src/ViewRepository/Product/ProductReviewsViewRepositoryInterface.php index b256c1411..11edc8233 100644 --- a/src/ViewRepository/ProductReviewsViewRepositoryInterface.php +++ b/src/ViewRepository/Product/ProductReviewsViewRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Sylius\ShopApiPlugin\ViewRepository; +namespace Sylius\ShopApiPlugin\ViewRepository\Product; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\View\PageView; From 545471c68f6fa032a50121494c2904419715d2e9 Mon Sep 17 00:00:00 2001 From: mamazu Date: Wed, 12 Dec 2018 17:42:29 +0100 Subject: [PATCH 2/4] Generalizing the service imports --- src/Resources/config/services/controllers.xml | 8 +------- src/Resources/config/services/factories.xml | 8 +------- src/Resources/config/services/handlers.xml | 5 +---- src/Resources/config/services/validators.xml | 5 +---- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/Resources/config/services/controllers.xml b/src/Resources/config/services/controllers.xml index bdc33af06..af0c50e2b 100644 --- a/src/Resources/config/services/controllers.xml +++ b/src/Resources/config/services/controllers.xml @@ -2,12 +2,6 @@ - - - - - - - + diff --git a/src/Resources/config/services/factories.xml b/src/Resources/config/services/factories.xml index a9f13a942..124b6e0ec 100644 --- a/src/Resources/config/services/factories.xml +++ b/src/Resources/config/services/factories.xml @@ -3,13 +3,7 @@ - - - - - - - + diff --git a/src/Resources/config/services/handlers.xml b/src/Resources/config/services/handlers.xml index 916ea76a3..464462795 100644 --- a/src/Resources/config/services/handlers.xml +++ b/src/Resources/config/services/handlers.xml @@ -5,10 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - - - + diff --git a/src/Resources/config/services/validators.xml b/src/Resources/config/services/validators.xml index 486e40f55..50e3f65d5 100644 --- a/src/Resources/config/services/validators.xml +++ b/src/Resources/config/services/validators.xml @@ -2,10 +2,7 @@ - - - - + From 753aea7511436fc95fd0674421d498b5bdb4527a Mon Sep 17 00:00:00 2001 From: mamazu Date: Wed, 12 Dec 2018 18:05:28 +0100 Subject: [PATCH 3/4] Fixing the import statements --- spec/ViewRepository/CartViewRepositorySpec.php | 2 +- spec/ViewRepository/PlacedOrderViewRepositorySpec.php | 2 +- spec/ViewRepository/ProductDetailsViewRepositorySpec.php | 2 +- src/Controller/Cart/AddCouponAction.php | 2 +- src/Controller/Cart/ChangeItemQuantityAction.php | 2 +- src/Controller/Cart/PickupAction.php | 2 +- src/Controller/Cart/PutItemToCartAction.php | 2 +- src/Controller/Cart/PutItemsToCartAction.php | 2 +- src/Controller/Cart/RemoveCouponAction.php | 2 +- src/Controller/Cart/RemoveItemFromCartAction.php | 2 +- src/Controller/Cart/SummarizeAction.php | 2 +- src/Controller/Order/ShowOrderDetailsAction.php | 2 +- src/Controller/Order/ShowOrdersListAction.php | 2 +- src/Controller/Product/ShowLatestProductAction.php | 2 +- src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php | 2 +- src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php | 2 +- src/Controller/Product/ShowProductDetailsByCodeAction.php | 2 +- src/Controller/Product/ShowProductDetailsBySlugAction.php | 2 +- src/Controller/Product/ShowProductReviewsByCodeAction.php | 2 +- src/Controller/Product/ShowProductReviewsBySlugAction.php | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/spec/ViewRepository/CartViewRepositorySpec.php b/spec/ViewRepository/CartViewRepositorySpec.php index 106effbd4..046343861 100644 --- a/spec/ViewRepository/CartViewRepositorySpec.php +++ b/spec/ViewRepository/CartViewRepositorySpec.php @@ -9,7 +9,7 @@ use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\ShopApiPlugin\Factory\CartViewFactoryInterface; use Sylius\ShopApiPlugin\View\CartSummaryView; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; final class CartViewRepositorySpec extends ObjectBehavior { diff --git a/spec/ViewRepository/PlacedOrderViewRepositorySpec.php b/spec/ViewRepository/PlacedOrderViewRepositorySpec.php index 18ab9b9e1..4acee1f65 100644 --- a/spec/ViewRepository/PlacedOrderViewRepositorySpec.php +++ b/spec/ViewRepository/PlacedOrderViewRepositorySpec.php @@ -13,7 +13,7 @@ use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\ShopApiPlugin\Factory\PlacedOrderViewFactoryInterface; use Sylius\ShopApiPlugin\View\PlacedOrderView; -use Sylius\ShopApiPlugin\ViewRepository\PlacedOrderViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Order\PlacedOrderViewRepositoryInterface; final class PlacedOrderViewRepositorySpec extends ObjectBehavior { diff --git a/spec/ViewRepository/ProductDetailsViewRepositorySpec.php b/spec/ViewRepository/ProductDetailsViewRepositorySpec.php index 197cdafc7..d670f6b1d 100644 --- a/spec/ViewRepository/ProductDetailsViewRepositorySpec.php +++ b/spec/ViewRepository/ProductDetailsViewRepositorySpec.php @@ -13,7 +13,7 @@ use Sylius\ShopApiPlugin\Factory\ProductViewFactoryInterface; use Sylius\ShopApiPlugin\Provider\SupportedLocaleProviderInterface; use Sylius\ShopApiPlugin\View\ProductView; -use Sylius\ShopApiPlugin\ViewRepository\ProductDetailsViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductDetailsViewRepositoryInterface; final class ProductDetailsViewRepositorySpec extends ObjectBehavior { diff --git a/src/Controller/Cart/AddCouponAction.php b/src/Controller/Cart/AddCouponAction.php index 5ccd65a20..aad65f503 100644 --- a/src/Controller/Cart/AddCouponAction.php +++ b/src/Controller/Cart/AddCouponAction.php @@ -9,7 +9,7 @@ use League\Tactician\CommandBus; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\AddCouponRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/ChangeItemQuantityAction.php b/src/Controller/Cart/ChangeItemQuantityAction.php index a0350a37f..8c7a14b4e 100644 --- a/src/Controller/Cart/ChangeItemQuantityAction.php +++ b/src/Controller/Cart/ChangeItemQuantityAction.php @@ -9,7 +9,7 @@ use League\Tactician\CommandBus; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\ChangeItemQuantityRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/PickupAction.php b/src/Controller/Cart/PickupAction.php index f969f5ad4..9debc2061 100644 --- a/src/Controller/Cart/PickupAction.php +++ b/src/Controller/Cart/PickupAction.php @@ -9,7 +9,7 @@ use League\Tactician\CommandBus; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\PickupCartRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/PutItemToCartAction.php b/src/Controller/Cart/PutItemToCartAction.php index 5cd25d3cf..e4e3130fc 100644 --- a/src/Controller/Cart/PutItemToCartAction.php +++ b/src/Controller/Cart/PutItemToCartAction.php @@ -12,7 +12,7 @@ use Sylius\ShopApiPlugin\Request\PutOptionBasedConfigurableItemToCartRequest; use Sylius\ShopApiPlugin\Request\PutSimpleItemToCartRequest; use Sylius\ShopApiPlugin\Request\PutVariantBasedConfigurableItemToCartRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/PutItemsToCartAction.php b/src/Controller/Cart/PutItemsToCartAction.php index 922ac2298..f3400ff4e 100644 --- a/src/Controller/Cart/PutItemsToCartAction.php +++ b/src/Controller/Cart/PutItemsToCartAction.php @@ -12,7 +12,7 @@ use Sylius\ShopApiPlugin\Request\PutSimpleItemToCartRequest; use Sylius\ShopApiPlugin\Request\PutVariantBasedConfigurableItemToCartRequest; use Sylius\ShopApiPlugin\View\ValidationErrorView; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/RemoveCouponAction.php b/src/Controller/Cart/RemoveCouponAction.php index f3ffd874a..d548f513c 100644 --- a/src/Controller/Cart/RemoveCouponAction.php +++ b/src/Controller/Cart/RemoveCouponAction.php @@ -9,7 +9,7 @@ use League\Tactician\CommandBus; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\RemoveCouponRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/RemoveItemFromCartAction.php b/src/Controller/Cart/RemoveItemFromCartAction.php index ef3338e04..f0cc5d2b4 100644 --- a/src/Controller/Cart/RemoveItemFromCartAction.php +++ b/src/Controller/Cart/RemoveItemFromCartAction.php @@ -9,7 +9,7 @@ use League\Tactician\CommandBus; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\RemoveItemFromCartRequest; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; diff --git a/src/Controller/Cart/SummarizeAction.php b/src/Controller/Cart/SummarizeAction.php index 91f31d361..2de105f95 100644 --- a/src/Controller/Cart/SummarizeAction.php +++ b/src/Controller/Cart/SummarizeAction.php @@ -6,7 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; -use Sylius\ShopApiPlugin\ViewRepository\CartViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Cart\CartViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Order/ShowOrderDetailsAction.php b/src/Controller/Order/ShowOrderDetailsAction.php index a2bc8cacd..05c96e0bc 100644 --- a/src/Controller/Order/ShowOrderDetailsAction.php +++ b/src/Controller/Order/ShowOrderDetailsAction.php @@ -8,7 +8,7 @@ use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\Component\Core\Model\ShopUserInterface; use Sylius\ShopApiPlugin\Provider\LoggedInUserProviderInterface; -use Sylius\ShopApiPlugin\ViewRepository\PlacedOrderViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Order\PlacedOrderViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Order/ShowOrdersListAction.php b/src/Controller/Order/ShowOrdersListAction.php index dcee12e03..3ddb277f5 100644 --- a/src/Controller/Order/ShowOrdersListAction.php +++ b/src/Controller/Order/ShowOrdersListAction.php @@ -8,7 +8,7 @@ use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\Component\Core\Model\ShopUserInterface; use Sylius\ShopApiPlugin\Provider\LoggedInUserProviderInterface; -use Sylius\ShopApiPlugin\ViewRepository\PlacedOrderViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Order\PlacedOrderViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\TokenNotFoundException; diff --git a/src/Controller/Product/ShowLatestProductAction.php b/src/Controller/Product/ShowLatestProductAction.php index 994e11d45..94aabe0f8 100644 --- a/src/Controller/Product/ShowLatestProductAction.php +++ b/src/Controller/Product/ShowLatestProductAction.php @@ -6,7 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; -use Sylius\ShopApiPlugin\ViewRepository\ProductLatestViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductLatestViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php b/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php index 84205b3de..0def4d06c 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php @@ -7,7 +7,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; -use Sylius\ShopApiPlugin\ViewRepository\ProductCatalogViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductCatalogViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php index b85cbf3af..1dfcf4cb2 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php @@ -7,7 +7,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; -use Sylius\ShopApiPlugin\ViewRepository\ProductCatalogViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductCatalogViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Product/ShowProductDetailsByCodeAction.php b/src/Controller/Product/ShowProductDetailsByCodeAction.php index 211e82e0e..935b6c254 100644 --- a/src/Controller/Product/ShowProductDetailsByCodeAction.php +++ b/src/Controller/Product/ShowProductDetailsByCodeAction.php @@ -6,7 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; -use Sylius\ShopApiPlugin\ViewRepository\ProductDetailsViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductDetailsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Product/ShowProductDetailsBySlugAction.php b/src/Controller/Product/ShowProductDetailsBySlugAction.php index 6788a4147..8c40fb087 100644 --- a/src/Controller/Product/ShowProductDetailsBySlugAction.php +++ b/src/Controller/Product/ShowProductDetailsBySlugAction.php @@ -6,7 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; -use Sylius\ShopApiPlugin\ViewRepository\ProductDetailsViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductDetailsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/Controller/Product/ShowProductReviewsByCodeAction.php b/src/Controller/Product/ShowProductReviewsByCodeAction.php index 737732023..eff94eab3 100644 --- a/src/Controller/Product/ShowProductReviewsByCodeAction.php +++ b/src/Controller/Product/ShowProductReviewsByCodeAction.php @@ -7,7 +7,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; -use Sylius\ShopApiPlugin\ViewRepository\ProductReviewsViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductReviewsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Controller/Product/ShowProductReviewsBySlugAction.php b/src/Controller/Product/ShowProductReviewsBySlugAction.php index 27b3399ba..7b23208a1 100644 --- a/src/Controller/Product/ShowProductReviewsBySlugAction.php +++ b/src/Controller/Product/ShowProductReviewsBySlugAction.php @@ -7,7 +7,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; -use Sylius\ShopApiPlugin\ViewRepository\ProductReviewsViewRepositoryInterface; +use Sylius\ShopApiPlugin\ViewRepository\Product\ProductReviewsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; From 261712ddfc2a1ce186047877a37abc7dba1bae5a Mon Sep 17 00:00:00 2001 From: mamazu Date: Wed, 12 Dec 2018 18:22:20 +0100 Subject: [PATCH 4/4] Moved the spec tests --- spec/ViewRepository/{ => Cart}/CartViewRepositorySpec.php | 2 +- .../{ => Order}/PlacedOrderViewRepositorySpec.php | 2 +- .../{ => Product}/ProductDetailsViewRepositorySpec.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename spec/ViewRepository/{ => Cart}/CartViewRepositorySpec.php (95%) rename spec/ViewRepository/{ => Order}/PlacedOrderViewRepositorySpec.php (98%) rename spec/ViewRepository/{ => Product}/ProductDetailsViewRepositorySpec.php (98%) diff --git a/spec/ViewRepository/CartViewRepositorySpec.php b/spec/ViewRepository/Cart/CartViewRepositorySpec.php similarity index 95% rename from spec/ViewRepository/CartViewRepositorySpec.php rename to spec/ViewRepository/Cart/CartViewRepositorySpec.php index 046343861..36f737f34 100644 --- a/spec/ViewRepository/CartViewRepositorySpec.php +++ b/spec/ViewRepository/Cart/CartViewRepositorySpec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace spec\Sylius\ShopApiPlugin\ViewRepository; +namespace spec\Sylius\ShopApiPlugin\ViewRepository\Cart; use PhpSpec\ObjectBehavior; use Sylius\Component\Core\Model\OrderInterface; diff --git a/spec/ViewRepository/PlacedOrderViewRepositorySpec.php b/spec/ViewRepository/Order/PlacedOrderViewRepositorySpec.php similarity index 98% rename from spec/ViewRepository/PlacedOrderViewRepositorySpec.php rename to spec/ViewRepository/Order/PlacedOrderViewRepositorySpec.php index 4acee1f65..ae12a2aa9 100644 --- a/spec/ViewRepository/PlacedOrderViewRepositorySpec.php +++ b/spec/ViewRepository/Order/PlacedOrderViewRepositorySpec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace spec\Sylius\ShopApiPlugin\ViewRepository; +namespace spec\Sylius\ShopApiPlugin\ViewRepository\Order; use PhpSpec\ObjectBehavior; use Prophecy\Argument; diff --git a/spec/ViewRepository/ProductDetailsViewRepositorySpec.php b/spec/ViewRepository/Product/ProductDetailsViewRepositorySpec.php similarity index 98% rename from spec/ViewRepository/ProductDetailsViewRepositorySpec.php rename to spec/ViewRepository/Product/ProductDetailsViewRepositorySpec.php index d670f6b1d..7168af871 100644 --- a/spec/ViewRepository/ProductDetailsViewRepositorySpec.php +++ b/spec/ViewRepository/Product/ProductDetailsViewRepositorySpec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace spec\Sylius\ShopApiPlugin\ViewRepository; +namespace spec\Sylius\ShopApiPlugin\ViewRepository\Product; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -31,7 +31,7 @@ function let( ); } - function it_is_product_catalog(): void + function it_is_product_detail(): void { $this->shouldImplement(ProductDetailsViewRepositoryInterface::class); }