From a4ce0135d88b316048e875c3f6bd1f67ae142b52 Mon Sep 17 00:00:00 2001 From: Anton Fedurtsya Date: Wed, 6 Dec 2023 15:55:22 +0200 Subject: [PATCH] OXDEV-7661 Split repositories by namespaces Signed-off-by: Anton Fedurtsya --- services.yaml | 1 - src/Setting/services.yaml | 10 ---------- .../Infrastructure/ShopSettingRepository.php | 2 +- .../Infrastructure/ShopSettingRepositoryInterface.php | 2 +- src/Shop/Service/ShopSettingService.php | 2 +- src/Shop/services.yaml | 3 +++ .../Infrastructure/ThemeSettingRepository.php | 2 +- .../Infrastructure/ThemeSettingRepositoryInterface.php | 2 +- src/Theme/Service/ThemeSettingService.php | 2 +- src/Theme/services.yaml | 3 +++ .../Infrastructure/ShopSettingRepositoryTest.php | 4 ++-- .../Infrastructure/ThemeSettingRepositoryTest.php | 4 ++-- .../AbstractShopSettingRepositoryTestCase.php | 4 ++-- .../AbstractThemeSettingRepositoryTestCase.php | 2 +- .../ShopSettingRepositoryGettersTest.php | 2 +- .../ShopSettingRepositorySettersTest.php | 2 +- .../ThemeSettingRepositoryGettersTest.php | 2 +- .../ThemeSettingRepositorySettersTest.php | 2 +- tests/Unit/Shop/Service/ShopSettingServiceTest.php | 2 +- tests/Unit/Theme/Service/ThemeSettingServiceTest.php | 2 +- 20 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 src/Setting/services.yaml rename src/{Setting => Shop}/Infrastructure/ShopSettingRepository.php (98%) rename src/{Setting => Shop}/Infrastructure/ShopSettingRepositoryInterface.php (94%) rename src/{Setting => Theme}/Infrastructure/ThemeSettingRepository.php (99%) rename src/{Setting => Theme}/Infrastructure/ThemeSettingRepositoryInterface.php (95%) diff --git a/services.yaml b/services.yaml index 1523a6c..8b5aa46 100644 --- a/services.yaml +++ b/services.yaml @@ -1,5 +1,4 @@ imports: - - { resource: src/Setting/services.yaml } - { resource: src/Shared/services.yaml } - { resource: src/Module/services.yaml } - { resource: src/Shop/services.yaml } diff --git a/src/Setting/services.yaml b/src/Setting/services.yaml deleted file mode 100644 index 7139792..0000000 --- a/src/Setting/services.yaml +++ /dev/null @@ -1,10 +0,0 @@ -services: - _defaults: - public: false - autowire: true - - OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepositoryInterface: - class: OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository - - OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepositoryInterface: - class: OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository diff --git a/src/Setting/Infrastructure/ShopSettingRepository.php b/src/Shop/Infrastructure/ShopSettingRepository.php similarity index 98% rename from src/Setting/Infrastructure/ShopSettingRepository.php rename to src/Shop/Infrastructure/ShopSettingRepository.php index cc99607..18a5c2a 100644 --- a/src/Setting/Infrastructure/ShopSettingRepository.php +++ b/src/Shop/Infrastructure/ShopSettingRepository.php @@ -7,7 +7,7 @@ declare(strict_types=1); -namespace OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure; +namespace OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure; use Doctrine\DBAL\Result; use OxidEsales\EshopCommunity\Internal\Framework\Config\Dao\ShopConfigurationSettingDaoInterface; diff --git a/src/Setting/Infrastructure/ShopSettingRepositoryInterface.php b/src/Shop/Infrastructure/ShopSettingRepositoryInterface.php similarity index 94% rename from src/Setting/Infrastructure/ShopSettingRepositoryInterface.php rename to src/Shop/Infrastructure/ShopSettingRepositoryInterface.php index b3530f1..d6fba00 100644 --- a/src/Setting/Infrastructure/ShopSettingRepositoryInterface.php +++ b/src/Shop/Infrastructure/ShopSettingRepositoryInterface.php @@ -5,7 +5,7 @@ * See LICENSE file for license details. */ -namespace OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure; +namespace OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure; interface ShopSettingRepositoryInterface { diff --git a/src/Shop/Service/ShopSettingService.php b/src/Shop/Service/ShopSettingService.php index 2a56332..8eafb8b 100644 --- a/src/Shop/Service/ShopSettingService.php +++ b/src/Shop/Service/ShopSettingService.php @@ -9,13 +9,13 @@ namespace OxidEsales\GraphQL\ConfigurationAccess\Shop\Service; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\BooleanSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\FloatSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\IntegerSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\SettingType; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\StringSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\CollectionEncodingServiceInterface; +use OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepositoryInterface; final class ShopSettingService implements ShopSettingServiceInterface { diff --git a/src/Shop/services.yaml b/src/Shop/services.yaml index f391a14..333a72c 100644 --- a/src/Shop/services.yaml +++ b/src/Shop/services.yaml @@ -9,3 +9,6 @@ services: OxidEsales\GraphQL\ConfigurationAccess\Shop\Service\ShopSettingServiceInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Shop\Service\ShopSettingService + + OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepositoryInterface: + class: OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository diff --git a/src/Setting/Infrastructure/ThemeSettingRepository.php b/src/Theme/Infrastructure/ThemeSettingRepository.php similarity index 99% rename from src/Setting/Infrastructure/ThemeSettingRepository.php rename to src/Theme/Infrastructure/ThemeSettingRepository.php index 15f4047..c400134 100644 --- a/src/Setting/Infrastructure/ThemeSettingRepository.php +++ b/src/Theme/Infrastructure/ThemeSettingRepository.php @@ -7,7 +7,7 @@ declare(strict_types=1); -namespace OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure; +namespace OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure; use Doctrine\DBAL\ForwardCompatibility\Result; use OxidEsales\EshopCommunity\Internal\Framework\Config\Utility\ShopSettingEncoderInterface; diff --git a/src/Setting/Infrastructure/ThemeSettingRepositoryInterface.php b/src/Theme/Infrastructure/ThemeSettingRepositoryInterface.php similarity index 95% rename from src/Setting/Infrastructure/ThemeSettingRepositoryInterface.php rename to src/Theme/Infrastructure/ThemeSettingRepositoryInterface.php index 8302430..45ed90a 100644 --- a/src/Setting/Infrastructure/ThemeSettingRepositoryInterface.php +++ b/src/Theme/Infrastructure/ThemeSettingRepositoryInterface.php @@ -5,7 +5,7 @@ * See LICENSE file for license details. */ -namespace OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure; +namespace OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure; interface ThemeSettingRepositoryInterface { diff --git a/src/Theme/Service/ThemeSettingService.php b/src/Theme/Service/ThemeSettingService.php index 64a2832..c8ceb50 100644 --- a/src/Theme/Service/ThemeSettingService.php +++ b/src/Theme/Service/ThemeSettingService.php @@ -9,7 +9,6 @@ namespace OxidEsales\GraphQL\ConfigurationAccess\Theme\Service; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\BooleanSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\FloatSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\IntegerSetting; @@ -17,6 +16,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\StringSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\InvalidCollectionException; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\CollectionEncodingServiceInterface; +use OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepositoryInterface; final class ThemeSettingService implements ThemeSettingServiceInterface { diff --git a/src/Theme/services.yaml b/src/Theme/services.yaml index 711c975..cfb3b73 100644 --- a/src/Theme/services.yaml +++ b/src/Theme/services.yaml @@ -9,3 +9,6 @@ services: OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeSettingServiceInterface: class: OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeSettingService + + OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepositoryInterface: + class: OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository diff --git a/tests/Integration/Infrastructure/ShopSettingRepositoryTest.php b/tests/Integration/Infrastructure/ShopSettingRepositoryTest.php index 2f4f730..c5d9c8c 100644 --- a/tests/Integration/Infrastructure/ShopSettingRepositoryTest.php +++ b/tests/Integration/Infrastructure/ShopSettingRepositoryTest.php @@ -15,11 +15,11 @@ use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface; use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface; use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\NoSettingsFoundForShopException; +use OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository */ class ShopSettingRepositoryTest extends IntegrationTestCase { diff --git a/tests/Integration/Infrastructure/ThemeSettingRepositoryTest.php b/tests/Integration/Infrastructure/ThemeSettingRepositoryTest.php index ae2badd..887273d 100644 --- a/tests/Integration/Infrastructure/ThemeSettingRepositoryTest.php +++ b/tests/Integration/Infrastructure/ThemeSettingRepositoryTest.php @@ -14,12 +14,12 @@ use OxidEsales\EshopCommunity\Internal\Framework\Theme\Event\ThemeSettingChangedEvent; use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface; use OxidEsales\EshopCommunity\Tests\Integration\IntegrationTestCase; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Enum\FieldType; +use OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository */ class ThemeSettingRepositoryTest extends IntegrationTestCase { diff --git a/tests/Unit/Infrastructure/AbstractShopSettingRepositoryTestCase.php b/tests/Unit/Infrastructure/AbstractShopSettingRepositoryTestCase.php index fdf3bbb..85018b7 100644 --- a/tests/Unit/Infrastructure/AbstractShopSettingRepositoryTestCase.php +++ b/tests/Unit/Infrastructure/AbstractShopSettingRepositoryTestCase.php @@ -13,8 +13,8 @@ use OxidEsales\EshopCommunity\Internal\Framework\Config\Utility\ShopSettingEncoderInterface; use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface; use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepositoryInterface; +use OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository; +use OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepositoryInterface; abstract class AbstractShopSettingRepositoryTestCase extends AbstractDatabaseSettingsRepositoryTestCase { diff --git a/tests/Unit/Infrastructure/AbstractThemeSettingRepositoryTestCase.php b/tests/Unit/Infrastructure/AbstractThemeSettingRepositoryTestCase.php index 3b3d0e3..39b2d41 100644 --- a/tests/Unit/Infrastructure/AbstractThemeSettingRepositoryTestCase.php +++ b/tests/Unit/Infrastructure/AbstractThemeSettingRepositoryTestCase.php @@ -12,7 +12,7 @@ use OxidEsales\EshopCommunity\Internal\Framework\Config\Utility\ShopSettingEncoderInterface; use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface; use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository; +use OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\EventDispatcher\EventDispatcherInterface; diff --git a/tests/Unit/Infrastructure/ShopSettingRepositoryGettersTest.php b/tests/Unit/Infrastructure/ShopSettingRepositoryGettersTest.php index d88d757..85a5aa1 100644 --- a/tests/Unit/Infrastructure/ShopSettingRepositoryGettersTest.php +++ b/tests/Unit/Infrastructure/ShopSettingRepositoryGettersTest.php @@ -14,7 +14,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\WrongSettingTypeException; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository */ class ShopSettingRepositoryGettersTest extends AbstractShopSettingRepositoryTestCase { diff --git a/tests/Unit/Infrastructure/ShopSettingRepositorySettersTest.php b/tests/Unit/Infrastructure/ShopSettingRepositorySettersTest.php index 675b28e..9fc6a22 100644 --- a/tests/Unit/Infrastructure/ShopSettingRepositorySettersTest.php +++ b/tests/Unit/Infrastructure/ShopSettingRepositorySettersTest.php @@ -15,7 +15,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\WrongSettingTypeException; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepository */ class ShopSettingRepositorySettersTest extends AbstractShopSettingRepositoryTestCase { diff --git a/tests/Unit/Infrastructure/ThemeSettingRepositoryGettersTest.php b/tests/Unit/Infrastructure/ThemeSettingRepositoryGettersTest.php index 77ea3d4..c5897c5 100644 --- a/tests/Unit/Infrastructure/ThemeSettingRepositoryGettersTest.php +++ b/tests/Unit/Infrastructure/ThemeSettingRepositoryGettersTest.php @@ -16,7 +16,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\NoSettingsFoundForThemeException; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository */ class ThemeSettingRepositoryGettersTest extends AbstractThemeSettingRepositoryTestCase { diff --git a/tests/Unit/Infrastructure/ThemeSettingRepositorySettersTest.php b/tests/Unit/Infrastructure/ThemeSettingRepositorySettersTest.php index 2cf6b9a..2128234 100644 --- a/tests/Unit/Infrastructure/ThemeSettingRepositorySettersTest.php +++ b/tests/Unit/Infrastructure/ThemeSettingRepositorySettersTest.php @@ -12,7 +12,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\NoSettingsFoundForThemeException; /** - * @covers \OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepository + * @covers \OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepository */ class ThemeSettingRepositorySettersTest extends AbstractThemeSettingRepositoryTestCase { diff --git a/tests/Unit/Shop/Service/ShopSettingServiceTest.php b/tests/Unit/Shop/Service/ShopSettingServiceTest.php index be08a96..9323ba0 100644 --- a/tests/Unit/Shop/Service/ShopSettingServiceTest.php +++ b/tests/Unit/Shop/Service/ShopSettingServiceTest.php @@ -9,13 +9,13 @@ namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Shop\Service; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ShopSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\BooleanSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\FloatSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\IntegerSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\StringSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Enum\FieldType; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\CollectionEncodingServiceInterface; +use OxidEsales\GraphQL\ConfigurationAccess\Shop\Infrastructure\ShopSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shop\Service\ShopSettingService; use OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\UnitTestCase; diff --git a/tests/Unit/Theme/Service/ThemeSettingServiceTest.php b/tests/Unit/Theme/Service/ThemeSettingServiceTest.php index 5eab3d5..d728cb0 100644 --- a/tests/Unit/Theme/Service/ThemeSettingServiceTest.php +++ b/tests/Unit/Theme/Service/ThemeSettingServiceTest.php @@ -9,7 +9,6 @@ namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Theme\Service; -use OxidEsales\GraphQL\ConfigurationAccess\Setting\Infrastructure\ThemeSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\BooleanSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\FloatSetting; use OxidEsales\GraphQL\ConfigurationAccess\Shared\DataType\IntegerSetting; @@ -18,6 +17,7 @@ use OxidEsales\GraphQL\ConfigurationAccess\Shared\Exception\InvalidCollectionException; use OxidEsales\GraphQL\ConfigurationAccess\Shared\Service\CollectionEncodingServiceInterface; use OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\UnitTestCase; +use OxidEsales\GraphQL\ConfigurationAccess\Theme\Infrastructure\ThemeSettingRepositoryInterface; use OxidEsales\GraphQL\ConfigurationAccess\Theme\Service\ThemeSettingService; use PHPUnit\Framework\MockObject\MockObject;