From 91941e2be7841a443fb2f32de65ab28054b13611 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 8 Oct 2024 12:40:13 +0200 Subject: [PATCH] Fix CI --- src/Attribute/Importer.php | 10 ++++++++-- src/AttributeOptions/Importer.php | 11 +++++++++-- src/Product/Importer.php | 5 ++++- src/Product/ProductOptionsResolver.php | 5 ++++- src/ProductAssociations/Importer.php | 10 ++++++++-- src/ProductOptionHelperTrait.php | 5 ++++- src/ProductOptionValueHelperTrait.php | 5 ++++- .../ItemImportResultRepositoryInterface.php | 5 ++++- src/SyliusProductAttributeHelperTrait.php | 5 ++++- src/ValueHandler/AttributeValueHandler.php | 10 ++++++++-- src/ValueHandler/ChannelPricingValueHandler.php | 10 ++++++++-- src/ValueHandler/ImageValueHandler.php | 10 ++++++++-- src/ValueHandler/ImmutableSlugValueHandler.php | 10 ++++++++-- src/ValueHandler/ProductOptionValueHandler.php | 10 ++++++++-- src/ValueHandler/TranslatablePropertyValueHandler.php | 5 ++++- 15 files changed, 93 insertions(+), 23 deletions(-) diff --git a/src/Attribute/Importer.php b/src/Attribute/Importer.php index a9c4ece2..61a071f8 100644 --- a/src/Attribute/Importer.php +++ b/src/Attribute/Importer.php @@ -4,6 +4,12 @@ namespace Webgriffe\SyliusAkeneoPlugin\Attribute; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; use Akeneo\Pim\ApiClient\Search\SearchBuilder; @@ -13,8 +19,8 @@ use Sylius\Component\Product\Model\ProductOptionInterface; use Sylius\Component\Product\Model\ProductOptionTranslationInterface; use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Webgriffe\SyliusAkeneoPlugin\Event\IdentifiersModifiedSinceSearchBuilderBuiltEvent; use Webgriffe\SyliusAkeneoPlugin\ImporterInterface; diff --git a/src/AttributeOptions/Importer.php b/src/AttributeOptions/Importer.php index d16f1b8a..c3b725dd 100644 --- a/src/AttributeOptions/Importer.php +++ b/src/AttributeOptions/Importer.php @@ -4,6 +4,13 @@ namespace Webgriffe\SyliusAkeneoPlugin\AttributeOptions; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} + +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; use Akeneo\Pim\ApiClient\Search\SearchBuilder; @@ -15,9 +22,9 @@ use Sylius\Component\Product\Model\ProductOptionValueInterface; use Sylius\Component\Product\Model\ProductOptionValueTranslationInterface; use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Webgriffe\SyliusAkeneoPlugin\Attribute\Importer as AttributeImporter; diff --git a/src/Product/Importer.php b/src/Product/Importer.php index 83d6c61d..5a4fa28e 100644 --- a/src/Product/Importer.php +++ b/src/Product/Importer.php @@ -4,6 +4,9 @@ namespace Webgriffe\SyliusAkeneoPlugin\Product; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Search\SearchBuilder; use DateTime; @@ -17,8 +20,8 @@ use Sylius\Component\Core\Repository\ProductVariantRepositoryInterface; use Sylius\Component\Product\Factory\ProductFactoryInterface; use Sylius\Component\Product\Factory\ProductVariantFactoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Model\ResourceInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Webgriffe\SyliusAkeneoPlugin\Event\IdentifiersModifiedSinceSearchBuilderBuiltEvent; use Webgriffe\SyliusAkeneoPlugin\ImporterInterface; diff --git a/src/Product/ProductOptionsResolver.php b/src/Product/ProductOptionsResolver.php index e8520288..fe9a2c40 100644 --- a/src/Product/ProductOptionsResolver.php +++ b/src/Product/ProductOptionsResolver.php @@ -4,13 +4,16 @@ namespace Webgriffe\SyliusAkeneoPlugin\Product; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Exception\HttpException; use RuntimeException; use Sylius\Component\Product\Model\ProductOptionInterface; use Sylius\Component\Product\Model\ProductOptionTranslationInterface; use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Webgriffe\SyliusAkeneoPlugin\ProductOptionHelperTrait; /** diff --git a/src/ProductAssociations/Importer.php b/src/ProductAssociations/Importer.php index fe236e3b..c03336ae 100644 --- a/src/ProductAssociations/Importer.php +++ b/src/ProductAssociations/Importer.php @@ -4,6 +4,12 @@ namespace Webgriffe\SyliusAkeneoPlugin\ProductAssociations; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Exception\HttpException; use Akeneo\Pim\ApiClient\Search\SearchBuilder; @@ -16,8 +22,8 @@ use Sylius\Component\Product\Model\ProductAssociationTypeInterface; use Sylius\Component\Product\Model\ProductInterface as BaseProductInterface; use Sylius\Component\Product\Repository\ProductAssociationTypeRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Webgriffe\SyliusAkeneoPlugin\Event\IdentifiersModifiedSinceSearchBuilderBuiltEvent; use Webgriffe\SyliusAkeneoPlugin\ImporterInterface; diff --git a/src/ProductOptionHelperTrait.php b/src/ProductOptionHelperTrait.php index e3bcf2ab..f82f2a6a 100644 --- a/src/ProductOptionHelperTrait.php +++ b/src/ProductOptionHelperTrait.php @@ -4,11 +4,14 @@ namespace Webgriffe\SyliusAkeneoPlugin; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; use Sylius\Component\Product\Model\ProductOptionInterface; use Sylius\Component\Product\Model\ProductOptionTranslationInterface; use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Webgriffe\SyliusAkeneoPlugin\Attribute\Importer as AttributeImporter; /** diff --git a/src/ProductOptionValueHelperTrait.php b/src/ProductOptionValueHelperTrait.php index 1cd5f683..f441f8f2 100644 --- a/src/ProductOptionValueHelperTrait.php +++ b/src/ProductOptionValueHelperTrait.php @@ -4,10 +4,13 @@ namespace Webgriffe\SyliusAkeneoPlugin; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Sylius\Component\Product\Model\ProductOptionInterface; use Sylius\Component\Product\Model\ProductOptionValueInterface; use Sylius\Component\Product\Model\ProductOptionValueTranslationInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Webmozart\Assert\Assert; diff --git a/src/Respository/ItemImportResultRepositoryInterface.php b/src/Respository/ItemImportResultRepositoryInterface.php index ff4cb611..4ddf0c2a 100644 --- a/src/Respository/ItemImportResultRepositoryInterface.php +++ b/src/Respository/ItemImportResultRepositoryInterface.php @@ -4,8 +4,11 @@ namespace Webgriffe\SyliusAkeneoPlugin\Respository; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use DateTimeInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; use Webgriffe\SyliusAkeneoPlugin\Entity\ItemImportResultInterface; /** diff --git a/src/SyliusProductAttributeHelperTrait.php b/src/SyliusProductAttributeHelperTrait.php index 375c35d2..e3e9532b 100644 --- a/src/SyliusProductAttributeHelperTrait.php +++ b/src/SyliusProductAttributeHelperTrait.php @@ -4,10 +4,13 @@ namespace Webgriffe\SyliusAkeneoPlugin; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use Akeneo\Pim\ApiClient\Pagination\ResourceCursorInterface; use Sylius\Component\Attribute\AttributeType\SelectAttributeType; use Sylius\Component\Product\Model\ProductAttributeInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; /** * @psalm-type AkeneoAttribute array{code: string, type: string, labels: array} diff --git a/src/ValueHandler/AttributeValueHandler.php b/src/ValueHandler/AttributeValueHandler.php index 0bf157e7..c63579c0 100644 --- a/src/ValueHandler/AttributeValueHandler.php +++ b/src/ValueHandler/AttributeValueHandler.php @@ -4,6 +4,12 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use InvalidArgumentException; use Sylius\Component\Attribute\AttributeType\CheckboxAttributeType; @@ -17,9 +23,9 @@ use Sylius\Component\Product\Model\ProductAttributeInterface; use Sylius\Component\Product\Model\ProductAttributeValueInterface; use Sylius\Component\Product\Model\ProductOptionInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Webgriffe\SyliusAkeneoPlugin\Converter\ValueConverterInterface; use Webgriffe\SyliusAkeneoPlugin\ProductAttributeHelperTrait; use Webgriffe\SyliusAkeneoPlugin\ValueHandlerInterface; diff --git a/src/ValueHandler/ChannelPricingValueHandler.php b/src/ValueHandler/ChannelPricingValueHandler.php index 49df9498..58c96ab0 100644 --- a/src/ValueHandler/ChannelPricingValueHandler.php +++ b/src/ValueHandler/ChannelPricingValueHandler.php @@ -4,14 +4,20 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use InvalidArgumentException; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\ChannelPricingInterface; use Sylius\Component\Core\Model\ProductVariantInterface; use Sylius\Component\Currency\Model\CurrencyInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Webgriffe\SyliusAkeneoPlugin\ValueHandlerInterface; use Webmozart\Assert\Assert; diff --git a/src/ValueHandler/ImageValueHandler.php b/src/ValueHandler/ImageValueHandler.php index 7fde6d68..c5db680e 100644 --- a/src/ValueHandler/ImageValueHandler.php +++ b/src/ValueHandler/ImageValueHandler.php @@ -4,6 +4,12 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use InvalidArgumentException; use SplFileInfo; @@ -11,8 +17,8 @@ use Sylius\Component\Core\Model\ProductImageInterface; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Model\ProductVariantInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpKernel\Exception\HttpException; use Webgriffe\SyliusAkeneoPlugin\TemporaryFilesManagerInterface; diff --git a/src/ValueHandler/ImmutableSlugValueHandler.php b/src/ValueHandler/ImmutableSlugValueHandler.php index a21fc837..948d6a58 100644 --- a/src/ValueHandler/ImmutableSlugValueHandler.php +++ b/src/ValueHandler/ImmutableSlugValueHandler.php @@ -4,14 +4,20 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use Cocur\Slugify\SlugifyInterface; use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Model\ProductTranslationInterface; use Sylius\Component\Core\Model\ProductVariantInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Webgriffe\SyliusAkeneoPlugin\ValueHandlerInterface; use Webmozart\Assert\Assert; diff --git a/src/ValueHandler/ProductOptionValueHandler.php b/src/ValueHandler/ProductOptionValueHandler.php index 3b0c1355..14ac3ced 100644 --- a/src/ValueHandler/ProductOptionValueHandler.php +++ b/src/ValueHandler/ProductOptionValueHandler.php @@ -4,6 +4,12 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class, \Sylius\Component\Resource\Repository\RepositoryInterface::class); +} use Akeneo\Pim\ApiClient\AkeneoPimClientInterface; use Akeneo\Pim\ApiClient\Exception\HttpException; use InvalidArgumentException; @@ -15,9 +21,9 @@ use Sylius\Component\Product\Model\ProductOptionValueInterface; use Sylius\Component\Product\Model\ProductOptionValueTranslationInterface; use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Webgriffe\SyliusAkeneoPlugin\ProductOptionValueHelperTrait; use Webgriffe\SyliusAkeneoPlugin\ValueHandlerInterface; diff --git a/src/ValueHandler/TranslatablePropertyValueHandler.php b/src/ValueHandler/TranslatablePropertyValueHandler.php index 08ab2f8f..849fbe05 100644 --- a/src/ValueHandler/TranslatablePropertyValueHandler.php +++ b/src/ValueHandler/TranslatablePropertyValueHandler.php @@ -4,13 +4,16 @@ namespace Webgriffe\SyliusAkeneoPlugin\ValueHandler; +if (!interface_exists(\Sylius\Resource\Factory\FactoryInterface::class)) { + class_alias(\Sylius\Resource\Factory\FactoryInterface::class, \Sylius\Component\Resource\Factory\FactoryInterface::class); +} use Sylius\Component\Channel\Model\ChannelInterface; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Model\ProductTranslationInterface; use Sylius\Component\Core\Model\ProductVariantInterface; use Sylius\Component\Product\Model\ProductVariantTranslationInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Webgriffe\SyliusAkeneoPlugin\ValueHandlerInterface; use Webmozart\Assert\Assert;