From fd135de76aa0f34e715bafd1475e60a12cea4822 Mon Sep 17 00:00:00 2001 From: Nicolas MELONI Date: Fri, 23 Apr 2021 09:45:51 +0200 Subject: [PATCH] [ECS] add presets for Symfony, PhpCsFixer and PHP73Migration --- composer.json | 2 +- ruleset/ecs.php | 14 ++++++++- src/Configuration/SettingConfiguration.php | 2 +- src/Controller/CategoriesController.php | 6 ++-- .../ProductFilterRulesController.php | 2 +- src/Controller/ProductsController.php | 6 ++-- src/Entity/CategoryConfiguration.php | 2 +- src/Filter/ProductFilter.php | 30 +++++++++---------- src/Manager/ProductOptionManager.php | 7 ++--- src/Manager/SettingsManager.php | 2 +- src/Manager/SettingsManagerInterface.php | 4 +-- src/Menu/AdminMenuListener.php | 20 ++++++------- src/Migrations/Version20200605081308.php | 4 +-- src/Migrations/Version20201028081617.php | 4 +-- .../AbstractModelAkeneoAttributeProcessor.php | 6 ++-- ...oductAttributeAkeneoAttributeProcessor.php | 4 +-- .../AkeneoAttributeDataProviderInterface.php | 4 +-- .../AkeneoAttributeProcessorProvider.php | 5 +--- ...eoReferenceEntityAttributeDataProvider.php | 4 +-- ...tityAttributeValueValueBuilderProvider.php | 5 +--- src/Repository/ProductRepository.php | 3 +- src/Service/ProductChannelEnabler.php | 7 ++--- .../SyliusAkeneoLocaleCodeProvider.php | 4 +-- src/SynoliaSyliusAkeneoPlugin.php | 12 +++++--- .../AbstractAttributeOptionTask.php | 6 ++-- .../Product/AbstractCreateProductEntities.php | 2 +- .../CreateConfigurableProductEntitiesTask.php | 6 ++-- .../CreateSimpleProductEntitiesTask.php | 10 +++---- src/Task/Product/InsertProductImagesTask.php | 2 +- .../InsertProductVariantImagesTask.php | 2 +- src/Task/Product/RetrieveProductsTask.php | 2 +- .../AddOrUpdateProductModelTask.php | 10 +++---- .../ProductModel/AddProductGroupsTask.php | 4 +-- .../RetrieveProductModelsTask.php | 4 +-- ...oAttributeToSyliusAttributeTransformer.php | 2 +- .../Attribute/MetricAttributeTypeMatcher.php | 2 +- tests/PHPUnit/Api/ApiTestCase.php | 12 ++++---- tests/PHPUnit/Api/GetCategoriesTest.php | 4 +++ tests/PHPUnit/Api/GetProductsTest.php | 4 +++ tests/PHPUnit/Filter/ProductFilterTest.php | 4 +++ .../AkeneoAttributeDataProviderTest.php | 4 +++ .../AkeneoAttributePropertiesProviderTest.php | 4 +++ .../PHPUnit/Retriever/FamilyRetrieverTest.php | 4 +++ .../Attribute/CreateUpdateDeleteTaskTest.php | 4 +++ .../Attribute/RetrieveAttributesTaskTest.php | 4 +++ .../CreateUpdateDeleteTaskTest.php | 4 +++ .../RetrieveOptionsTaskTest.php | 4 +++ .../Category/CreateUpdateDeleteTaskTest.php | 4 +++ .../Category/RetrieveCategoriesTaskTest.php | 4 +++ ...ateConfigurableProductEntitiesTaskTest.php | 9 ++++-- .../CreateSimpleProductEntitiesTaskTest.php | 10 +++++-- .../Product/EnableDisableProductTaskTest.php | 6 ++-- .../Task/Product/RetrieveProductTaskTest.php | 4 +++ .../AddFamilyVariationAxeTaskTest.php | 4 +++ .../AddOrUpdateProductModelTaskTest.php | 6 +++- .../EnableDisableProductModelTaskTest.php | 6 +++- .../RetrieveProductModelTaskTest.php | 4 +++ .../ProductOption/CreateUpdateTaskTest.php | 4 +++ .../Task/ProductOption/DeleteTaskTest.php | 4 +++ ...ributeToSyliusAttributeTransformerTest.php | 4 +++ .../Attribute/AttributeTypeMatcherTest.php | 4 +++ 61 files changed, 216 insertions(+), 120 deletions(-) diff --git a/composer.json b/composer.json index 7524de42..2f0b34f8 100644 --- a/composer.json +++ b/composer.json @@ -78,7 +78,7 @@ } }, "scripts": { - "fix-ecs": "ecs check -c ruleset/easy-coding-standard.yml --fix --ansi --clear-cache .", + "fix-ecs": "ecs check -c ruleset/ecs.php --fix --ansi --clear-cache", "patch" : "php bin/patch" } } diff --git a/ruleset/ecs.php b/ruleset/ecs.php index d2d1f7c6..aefa65a5 100644 --- a/ruleset/ecs.php +++ b/ruleset/ecs.php @@ -4,6 +4,7 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\EasyCodingStandard\ValueObject\Set\SetList; return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->import(dirname(__DIR__) . '/vendor/sylius-labs/coding-standard/ecs.php'); @@ -13,6 +14,17 @@ dirname(__DIR__, 1) . '/src', dirname(__DIR__, 1) . '/tests/Behat', dirname(__DIR__, 1) . '/tests/PHPUnit', - dirname(__DIR__, 1) . '/spec' + dirname(__DIR__, 1) . '/spec', + ]); + + $parameters->set(Option::SETS, [ + SetList::SYMFONY, + SetList::PHP_73_MIGRATION, + SetList::PHP_CS_FIXER, + ]); + $parameters->set(Option::SKIP, [ + PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class => [ + dirname(__DIR__, 1) . '/src/*/*Configuration*.php', + ] ]); }; diff --git a/src/Configuration/SettingConfiguration.php b/src/Configuration/SettingConfiguration.php index e5edd2da..61676ab3 100644 --- a/src/Configuration/SettingConfiguration.php +++ b/src/Configuration/SettingConfiguration.php @@ -9,7 +9,7 @@ use Symfony\Component\Config\Definition\Exception\InvalidTypeException; /** - * Class SettingConfiguration + * Class SettingConfiguration. */ final class SettingConfiguration implements ConfigurationInterface { diff --git a/src/Controller/CategoriesController.php b/src/Controller/CategoriesController.php index db5ac791..3706c1c2 100644 --- a/src/Controller/CategoriesController.php +++ b/src/Controller/CategoriesController.php @@ -60,7 +60,7 @@ public function __invoke(Request $request): Response if ($this->categoriesConfigurationRepository instanceof CategoryConfigurationRepository) { $categoriesConfigurations = $this->categoriesConfigurationRepository->getCategoriesConfiguration(); } - if ($categoriesConfigurations === null) { + if (null === $categoriesConfigurations) { $categoriesConfigurations = new CategoryConfiguration(); } @@ -75,8 +75,8 @@ public function __invoke(Request $request): Response } return $this->render('@SynoliaSyliusAkeneoPlugin/Admin/AkeneoConnector/categories.html.twig', [ - 'form' => $form->createView(), - ] + 'form' => $form->createView(), + ] ); } } diff --git a/src/Controller/ProductFilterRulesController.php b/src/Controller/ProductFilterRulesController.php index e3a3b911..da3d60fc 100644 --- a/src/Controller/ProductFilterRulesController.php +++ b/src/Controller/ProductFilterRulesController.php @@ -59,7 +59,7 @@ public function __invoke(Request $request): Response } $productFiltersRules = $this->productFiltersRulesRepository->getProductFiltersRules(); - if ($productFiltersRules === null) { + if (null === $productFiltersRules) { $productFiltersRules = new ProductFiltersRules(); } diff --git a/src/Controller/ProductsController.php b/src/Controller/ProductsController.php index d0730bd3..78e2c101 100644 --- a/src/Controller/ProductsController.php +++ b/src/Controller/ProductsController.php @@ -76,14 +76,14 @@ public function __invoke(Request $request): Response } return $this->render('@SynoliaSyliusAkeneoPlugin/Admin/AkeneoConnector/products_configuration.html.twig', [ - 'form' => $form->createView(), - ] + 'form' => $form->createView(), + ] ); } private function removeElements(?Collection $productConfiguration, ?Collection $productConfigurationData): void { - if ($productConfiguration === null || $productConfigurationData === null) { + if (null === $productConfiguration || null === $productConfigurationData) { return; } diff --git a/src/Entity/CategoryConfiguration.php b/src/Entity/CategoryConfiguration.php index 1d61dd86..11436554 100644 --- a/src/Entity/CategoryConfiguration.php +++ b/src/Entity/CategoryConfiguration.php @@ -9,7 +9,7 @@ /** * @ORM\Entity(repositoryClass="CategoryConfigurationRepository") - + * * @ORM\Table("akeneo_api_configuration_categories") */ class CategoryConfiguration implements ResourceInterface diff --git a/src/Filter/ProductFilter.php b/src/Filter/ProductFilter.php index a540aaae..1050ead9 100644 --- a/src/Filter/ProductFilter.php +++ b/src/Filter/ProductFilter.php @@ -52,13 +52,13 @@ public function getProductModelFilters(): array } $queryParameters = []; - if ($productFilterRules->getMode() === ProductFilterRuleSimpleType::MODE) { + if (ProductFilterRuleSimpleType::MODE === $productFilterRules->getMode()) { $queryParameters = new SearchBuilder(); $queryParameters = $this->getUpdatedFilter($productFilterRules, $queryParameters); $completeness = self::AT_LEAST_COMPLETE; - if ($productFilterRules->getCompletenessValue() === self::FULL_COMPLETE) { + if (self::FULL_COMPLETE === $productFilterRules->getCompletenessValue()) { $completeness = self::ALL_COMPLETE; } $this->getCompletenessFilter($productFilterRules, $queryParameters, $completeness); @@ -68,7 +68,7 @@ public function getProductModelFilters(): array $queryParameters = ['search' => $queryParameters, 'scope' => $productFilterRules->getChannel()]; } - if ($productFilterRules->getMode() === ProductFilterRuleAdvancedType::MODE && !empty($productFilterRules->getAdvancedFilter())) { + if (ProductFilterRuleAdvancedType::MODE === $productFilterRules->getMode() && !empty($productFilterRules->getAdvancedFilter())) { return $this->getAdvancedFilter($productFilterRules, true); } @@ -84,7 +84,7 @@ public function getProductFilters(): array } $queryParameters = []; - if ($productFilterRules->getMode() === ProductFilterRuleSimpleType::MODE) { + if (ProductFilterRuleSimpleType::MODE === $productFilterRules->getMode()) { $queryParameters = new SearchBuilder(); $queryParameters = $this->getUpdatedFilter($productFilterRules, $queryParameters); @@ -101,7 +101,7 @@ public function getProductFilters(): array $queryParameters = ['search' => $queryParameters, 'scope' => $productFilterRules->getChannel()]; } - if ($productFilterRules->getMode() === ProductFilterRuleAdvancedType::MODE && !empty($productFilterRules->getAdvancedFilter())) { + if (ProductFilterRuleAdvancedType::MODE === $productFilterRules->getMode() && !empty($productFilterRules->getAdvancedFilter())) { return $this->getAdvancedFilter($productFilterRules); } @@ -111,20 +111,20 @@ public function getProductFilters(): array private function getStatus(ProductFiltersRules $productFilterRules, SearchBuilder $queryParameters): SearchBuilder { $status = $productFilterRules->getStatus(); - if ($status === ProductFilterStatusEnum::NO_CONDITION) { + if (ProductFilterStatusEnum::NO_CONDITION === $status) { return $queryParameters; } return $queryParameters->addFilter( 'enabled', Operator::EQUAL, - $status === ProductFilterStatusEnum::ENABLED + ProductFilterStatusEnum::ENABLED === $status ); } private function getAdvancedFilter(ProductFiltersRules $productFilterRules, bool $isProductModelFilter = false): array { - if ($productFilterRules->getAdvancedFilter() === null) { + if (null === $productFilterRules->getAdvancedFilter()) { return []; } @@ -134,7 +134,7 @@ private function getAdvancedFilter(ProductFiltersRules $productFilterRules, bool } $advancedFilter['search'] = json_decode($advancedFilter['search'], true); - if ($isProductModelFilter === true) { + if (true === $isProductModelFilter) { return $this->getProductModelAdvancedFilter($advancedFilter); } @@ -144,7 +144,7 @@ private function getAdvancedFilter(ProductFiltersRules $productFilterRules, bool private function getProductModelCompletenessTypeAdvancedFilter(array $filter): array { $filter['search']['completeness'][0]['operator'] = self::AT_LEAST_COMPLETE; - if ($filter['search']['completeness'][0]['value'] === self::FULL_COMPLETE) { + if (self::FULL_COMPLETE === $filter['search']['completeness'][0]['value']) { $filter['search']['completeness'][0]['operator'] = self::ALL_COMPLETE; } unset($filter['search']['completeness'][0]['value']); @@ -168,21 +168,21 @@ private function getProductModelAdvancedFilter(array $advancedFilter): array private function getUpdatedFilter(ProductFiltersRules $productFilterRules, SearchBuilder $queryParameters): SearchBuilder { $updatedMode = $productFilterRules->getUpdatedMode(); - if ($updatedMode === Operator::GREATER_THAN) { + if (Operator::GREATER_THAN === $updatedMode) { $queryParameters->addFilter( 'updated', $updatedMode, $productFilterRules->getUpdatedAfter()->format(self::API_DATETIME_FORMAT) ); } - if ($updatedMode === Operator::LOWER_THAN) { + if (Operator::LOWER_THAN === $updatedMode) { $queryParameters->addFilter( 'updated', $updatedMode, $productFilterRules->getUpdatedBefore()->format(self::API_DATETIME_FORMAT) ); } - if ($updatedMode === Operator::BETWEEN) { + if (Operator::BETWEEN === $updatedMode) { $queryParameters->addFilter( 'updated', $updatedMode, @@ -192,7 +192,7 @@ private function getUpdatedFilter(ProductFiltersRules $productFilterRules, Searc ] ); } - if ($updatedMode === Operator::SINCE_LAST_N_DAYS) { + if (Operator::SINCE_LAST_N_DAYS === $updatedMode) { $queryParameters->addFilter( 'updated', $updatedMode, @@ -237,7 +237,7 @@ private function getCompletenessFilter( ?int $completenessValue = null ): SearchBuilder { $completenessType = $productFilterRules->getCompletenessType(); - if ($completeness === null || $completenessType === null) { + if (null === $completeness || null === $completenessType) { return $queryParameters; } diff --git a/src/Manager/ProductOptionManager.php b/src/Manager/ProductOptionManager.php index 275a0f0a..fbbb3012 100644 --- a/src/Manager/ProductOptionManager.php +++ b/src/Manager/ProductOptionManager.php @@ -85,10 +85,7 @@ public function __construct( public function getProductOptionFromAttribute(AttributeInterface $attribute): ?ProductOptionInterface { - /** @var ProductOptionInterface|null $productOption */ - $productOption = $this->productOptionRepository->findOneBy(['code' => $attribute->getCode()]); - - return $productOption; + return $this->productOptionRepository->findOneBy(['code' => $attribute->getCode()]); } public function createProductOptionFromAttribute(AttributeInterface $attribute): ProductOptionInterface @@ -156,7 +153,7 @@ private function getLocales(): iterable private function updateProductOptionValues(ProductOptionInterface $productOption, AttributeInterface $attribute): void { - if ($attribute->getType() !== SelectAttributeType::TYPE) { + if (SelectAttributeType::TYPE !== $attribute->getType()) { return; } diff --git a/src/Manager/SettingsManager.php b/src/Manager/SettingsManager.php index 92da4f72..6deaf58d 100644 --- a/src/Manager/SettingsManager.php +++ b/src/Manager/SettingsManager.php @@ -20,7 +20,7 @@ public function __construct(EntityManagerInterface $entityManager) } /** - * Return setting value by its name + * Return setting value by its name. * * @param mixed|null $default Value to return if the setting is not set * diff --git a/src/Manager/SettingsManagerInterface.php b/src/Manager/SettingsManagerInterface.php index cbcf9473..2c6e609b 100644 --- a/src/Manager/SettingsManagerInterface.php +++ b/src/Manager/SettingsManagerInterface.php @@ -7,7 +7,7 @@ interface SettingsManagerInterface { /** - * Return setting value by its name + * Return setting value by its name. * * @param mixed|null $default Value to return if the setting is not set * @@ -21,7 +21,7 @@ public function get(string $name, $default = null); public function set(string $name, $value): self; /** - * Clears setting value + * Clears setting value. */ public function clear(string $name): self; } diff --git a/src/Menu/AdminMenuListener.php b/src/Menu/AdminMenuListener.php index 127a98ea..d070955a 100644 --- a/src/Menu/AdminMenuListener.php +++ b/src/Menu/AdminMenuListener.php @@ -17,40 +17,40 @@ public function addAdminMenuItems(MenuBuilderEvent $event): void $newSubmenu = $menu->addChild('akeneo'); $newSubmenu->addChild('sylius_admin_akeneo_api_configuration', [ - 'route' => 'sylius_akeneo_connector_api_configuration', - ]) + 'route' => 'sylius_akeneo_connector_api_configuration', + ]) ->setAttribute('type', 'link') ->setLabel('sylius.ui.admin.akeneo.api_configuration.title') ->setLabelAttribute('icon', 'cogs') ; $newSubmenu->addChild('sylius_admin_akeneo_product_filter_rules', [ - 'route' => 'sylius_akeneo_connector_product_filter_rules', - ]) + 'route' => 'sylius_akeneo_connector_product_filter_rules', + ]) ->setAttribute('type', 'link') ->setLabel('sylius.ui.admin.akeneo.product_filter_rules.title') ->setLabelAttribute('icon', 'sync alternate') ; $newSubmenu->addChild('sylius_admin_akeneo_categories', [ - 'route' => 'sylius_akeneo_connector_categories', - ]) + 'route' => 'sylius_akeneo_connector_categories', + ]) ->setAttribute('type', 'link') ->setLabel('sylius.ui.admin.akeneo.categories.title') ->setLabelAttribute('icon', 'configure') ; $newSubmenu->addChild('sylius_admin_akeneo_products', [ - 'route' => 'sylius_akeneo_connector_products', - ]) + 'route' => 'sylius_akeneo_connector_products', + ]) ->setAttribute('type', 'link') ->setLabel('sylius.ui.admin.akeneo.products.title') ->setLabelAttribute('icon', 'configure') ; $newSubmenu->addChild('sylius_admin_akeneo_attributes', [ - 'route' => 'sylius_akeneo_connector_attributes', - ]) + 'route' => 'sylius_akeneo_connector_attributes', + ]) ->setAttribute('type', 'link') ->setLabel('sylius.ui.admin.akeneo.attributes.title') ->setLabelAttribute('icon', 'configure') diff --git a/src/Migrations/Version20200605081308.php b/src/Migrations/Version20200605081308.php index cb46ac08..6a615bf0 100644 --- a/src/Migrations/Version20200605081308.php +++ b/src/Migrations/Version20200605081308.php @@ -20,7 +20,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE akeneo_api_configuration_product ( id INT AUTO_INCREMENT NOT NULL, @@ -135,7 +135,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE akeneo_api_configuration_product_images_mapping diff --git a/src/Migrations/Version20201028081617.php b/src/Migrations/Version20201028081617.php index e08241d5..349eef25 100644 --- a/src/Migrations/Version20201028081617.php +++ b/src/Migrations/Version20201028081617.php @@ -20,7 +20,7 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE akeneo_api_configuration DROP token, DROP refreshToken'); } @@ -28,7 +28,7 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE akeneo_api_configuration diff --git a/src/Processor/ProductAttribute/AbstractModelAkeneoAttributeProcessor.php b/src/Processor/ProductAttribute/AbstractModelAkeneoAttributeProcessor.php index 94b8bd16..f837aa80 100644 --- a/src/Processor/ProductAttribute/AbstractModelAkeneoAttributeProcessor.php +++ b/src/Processor/ProductAttribute/AbstractModelAkeneoAttributeProcessor.php @@ -58,12 +58,12 @@ public function process(string $attributeCode, array $context = []): void )); foreach ($context['data'] as $translation) { - if ($translation['locale'] !== null - && $this->syliusAkeneoLocaleCodeProvider->isActiveLocale($translation['locale']) === false) { + if (null !== $translation['locale'] + && false === $this->syliusAkeneoLocaleCodeProvider->isActiveLocale($translation['locale'])) { continue; } - if ($translation['locale'] === null) { + if (null === $translation['locale']) { foreach ($this->syliusAkeneoLocaleCodeProvider->getUsedLocalesOnBothPlatforms() as $locale) { $this->setValueToMethod($context['model'], $attributeCode, $context['data'], $locale, $context['scope']); } diff --git a/src/Processor/ProductAttribute/ProductAttributeAkeneoAttributeProcessor.php b/src/Processor/ProductAttribute/ProductAttributeAkeneoAttributeProcessor.php index 3a1508ad..048de57c 100644 --- a/src/Processor/ProductAttribute/ProductAttributeAkeneoAttributeProcessor.php +++ b/src/Processor/ProductAttribute/ProductAttributeAkeneoAttributeProcessor.php @@ -102,11 +102,11 @@ public function process(string $attributeCode, array $context = []): void $attribute = $this->productAttributeRepository->findOneBy(['code' => $transformedAttributeCode]); foreach ($context['data'] as $translation) { - if ($translation['locale'] !== null && $this->syliusAkeneoLocaleCodeProvider->isActiveLocale($translation['locale']) === false) { + if (null !== $translation['locale'] && false === $this->syliusAkeneoLocaleCodeProvider->isActiveLocale($translation['locale'])) { continue; } - if ($translation['locale'] === null) { + if (null === $translation['locale']) { foreach ($this->syliusAkeneoLocaleCodeProvider->getUsedLocalesOnBothPlatforms() as $locale) { $this->setAttributeTranslation( $context['model'], diff --git a/src/Provider/AkeneoAttributeDataProviderInterface.php b/src/Provider/AkeneoAttributeDataProviderInterface.php index 476b7013..bc3cf670 100644 --- a/src/Provider/AkeneoAttributeDataProviderInterface.php +++ b/src/Provider/AkeneoAttributeDataProviderInterface.php @@ -9,11 +9,11 @@ interface AkeneoAttributeDataProviderInterface /** * @param mixed $attributeValues * - * @return mixed|null - * * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingLocaleTranslationOrScopeException * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingScopeException * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingLocaleTranslationException + * + * @return mixed|null */ public function getData(string $attributeCode, $attributeValues, string $locale, string $scope); } diff --git a/src/Provider/AkeneoAttributeProcessorProvider.php b/src/Provider/AkeneoAttributeProcessorProvider.php index aaa0a9f0..d6593823 100644 --- a/src/Provider/AkeneoAttributeProcessorProvider.php +++ b/src/Provider/AkeneoAttributeProcessorProvider.php @@ -30,9 +30,6 @@ public function getProcessor(string $attributeCode, array $context = []): Akeneo } } - throw new MissingAkeneoAttributeProcessorException(\sprintf( - 'Could not find an AkeneoAttributeProcessor for attribute %s', - $attributeCode - )); + throw new MissingAkeneoAttributeProcessorException(\sprintf('Could not find an AkeneoAttributeProcessor for attribute %s', $attributeCode)); } } diff --git a/src/Provider/AkeneoReferenceEntityAttributeDataProvider.php b/src/Provider/AkeneoReferenceEntityAttributeDataProvider.php index 27bedda0..6b177cda 100644 --- a/src/Provider/AkeneoReferenceEntityAttributeDataProvider.php +++ b/src/Provider/AkeneoReferenceEntityAttributeDataProvider.php @@ -23,12 +23,12 @@ public function __construct( /** * @param mixed $attributeValues * - * @return mixed|null - * * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingLocaleTranslationOrScopeException * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingScopeException * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingLocaleTranslationException * @throws \Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\TranslationNotFoundException + * + * @return mixed|null */ public function getData( string $referenceEntityCode, diff --git a/src/Provider/ProductRefEntityAttributeValueValueBuilderProvider.php b/src/Provider/ProductRefEntityAttributeValueValueBuilderProvider.php index af5fd2f6..d7c8857d 100644 --- a/src/Provider/ProductRefEntityAttributeValueValueBuilderProvider.php +++ b/src/Provider/ProductRefEntityAttributeValueValueBuilderProvider.php @@ -40,9 +40,6 @@ public function getProcessor( } } - throw new MissingAkeneoAttributeProcessorException(\sprintf( - 'Could not find an AkeneoAttributeProcessor for attribute %s', - $attributeCode - )); + throw new MissingAkeneoAttributeProcessorException(\sprintf('Could not find an AkeneoAttributeProcessor for attribute %s', $attributeCode)); } } diff --git a/src/Repository/ProductRepository.php b/src/Repository/ProductRepository.php index 38e00d0e..caa7b416 100644 --- a/src/Repository/ProductRepository.php +++ b/src/Repository/ProductRepository.php @@ -21,6 +21,7 @@ public function findProductsUsingCategories(array $ids): iterable ->where('p.mainTaxon IN (:ids)') ->setParameter('ids', $ids) ->getQuery() - ->getResult(); + ->getResult() + ; } } diff --git a/src/Service/ProductChannelEnabler.php b/src/Service/ProductChannelEnabler.php index 73085591..474b9057 100644 --- a/src/Service/ProductChannelEnabler.php +++ b/src/Service/ProductChannelEnabler.php @@ -98,16 +98,13 @@ public function getEnabledChannelsAttributeData(ProductInterface $product, array continue; } - if (\count($attributeValue) === 0) { + if (0 === \count($attributeValue)) { throw new \LogicException('Enabled channels attribute is empty.'); } return \current($attributeValue)['data']; } - throw new NoAttributeResourcesException(\sprintf( - 'Enabled channels attribute not found for product "%s".', - $product->getCode() - )); + throw new NoAttributeResourcesException(\sprintf('Enabled channels attribute not found for product "%s".', $product->getCode())); } } diff --git a/src/Service/SyliusAkeneoLocaleCodeProvider.php b/src/Service/SyliusAkeneoLocaleCodeProvider.php index d2c7cf05..c6d49ab6 100644 --- a/src/Service/SyliusAkeneoLocaleCodeProvider.php +++ b/src/Service/SyliusAkeneoLocaleCodeProvider.php @@ -29,12 +29,12 @@ public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient, public function getUsedLocalesOnBothPlatforms(): array { - if ($this->localesCode !== []) { + if ([] !== $this->localesCode) { return $this->localesCode; } foreach ($this->getUsedLocalesOnAkeneo() as $apiLocale) { - if ($apiLocale['enabled'] === false || !in_array($apiLocale['code'], $this->getUsedLocalesOnSylius(), true)) { + if (false === $apiLocale['enabled'] || !in_array($apiLocale['code'], $this->getUsedLocalesOnSylius(), true)) { continue; } $this->localesCode[$apiLocale['code']] = $apiLocale['code']; diff --git a/src/SynoliaSyliusAkeneoPlugin.php b/src/SynoliaSyliusAkeneoPlugin.php index 32b8752a..468958d5 100644 --- a/src/SynoliaSyliusAkeneoPlugin.php +++ b/src/SynoliaSyliusAkeneoPlugin.php @@ -28,17 +28,21 @@ public function build(ContainerBuilder $container): void $container ->registerForAutoconfiguration(AkeneoTaskInterface::class) - ->addTag(AkeneoTaskInterface::TAG_ID); + ->addTag(AkeneoTaskInterface::TAG_ID) + ; $container->addCompilerPass(new AkeneoTaskCompilerPass()); $container ->registerForAutoconfiguration(AttributeTypeMatcherInterface::class) - ->addTag(AttributeTypeMatcherInterface::TAG_ID); + ->addTag(AttributeTypeMatcherInterface::TAG_ID) + ; $container ->registerForAutoconfiguration(ReferenceEntityAttributeTypeMatcherInterface::class) - ->addTag(ReferenceEntityAttributeTypeMatcherInterface::TAG_ID); + ->addTag(ReferenceEntityAttributeTypeMatcherInterface::TAG_ID) + ; $container ->registerForAutoconfiguration(ProductAttributeValueValueBuilderInterface::class) - ->addTag(ProductAttributeValueValueBuilderInterface::TAG_ID); + ->addTag(ProductAttributeValueValueBuilderInterface::TAG_ID) + ; $container->addCompilerPass(new AkeneoAttributeTypeMatcherCompilerPass()); $container->addCompilerPass(new AkeneoReferenceentityAttributeTypeMatcherCompilerPass()); diff --git a/src/Task/AttributeOption/AbstractAttributeOptionTask.php b/src/Task/AttributeOption/AbstractAttributeOptionTask.php index a8866bf1..e0b449fb 100644 --- a/src/Task/AttributeOption/AbstractAttributeOptionTask.php +++ b/src/Task/AttributeOption/AbstractAttributeOptionTask.php @@ -45,7 +45,7 @@ public function __construct( protected function getUnusedLocale(array $labels): array { $localeDiff = array_diff($this->syliusAkeneoLocaleCodeProvider->getUsedLocalesOnBothPlatforms(), array_keys($labels)); - if ($localeDiff === []) { + if ([] === $localeDiff) { return []; } @@ -67,14 +67,14 @@ protected function setAttributeChoices( if (!in_array($locale, $this->syliusAkeneoLocaleCodeProvider->getUsedLocalesOnBothPlatforms(), true)) { continue; } - if (!isset($choices[self::AKENEO_PREFIX . $option['code']]) && $this->getUnusedLocale($option['labels']) !== []) { + if (!isset($choices[self::AKENEO_PREFIX . $option['code']]) && [] !== $this->getUnusedLocale($option['labels'])) { $choices[self::AKENEO_PREFIX . $option['code']] = $this->getUnusedLocale($option['labels']); } $choices[self::AKENEO_PREFIX . $option['code']][$locale] = $label; } } - if ($choices === []) { + if ([] === $choices) { $this->entityManager->remove($attribute); return; diff --git a/src/Task/Product/AbstractCreateProductEntities.php b/src/Task/Product/AbstractCreateProductEntities.php index b39f0d3a..22f68b2f 100644 --- a/src/Task/Product/AbstractCreateProductEntities.php +++ b/src/Task/Product/AbstractCreateProductEntities.php @@ -188,7 +188,7 @@ private function getPriceAttributeData(array $attributes): array continue; } - if (\count($attributeValue) === 0) { + if (0 === \count($attributeValue)) { throw new \LogicException('Price attribute is empty.'); } diff --git a/src/Task/Product/CreateConfigurableProductEntitiesTask.php b/src/Task/Product/CreateConfigurableProductEntitiesTask.php index 392889e4..e374de41 100644 --- a/src/Task/Product/CreateConfigurableProductEntitiesTask.php +++ b/src/Task/Product/CreateConfigurableProductEntitiesTask.php @@ -194,7 +194,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $variationAxes = $productGroup->getVariationAxes(); - if (\count($variationAxes) === 0) { + if (0 === \count($variationAxes)) { $this->logger->warning(\sprintf( 'Skipped product "%s" because group has no variation axis.', $resource['identifier'], @@ -232,12 +232,12 @@ private function processVariations( ): ProductVariantInterface { $productVariant = $this->getOrCreateEntity($variantCode, $productModel); - /** + /* * TODO: In the future * Do not process attributes of the model * Add family and family_variant to the ProductGroup model for reference * Foreach attributes not in the last variation axis, remove them. - **/ + */ foreach ($attributes as $attributeCode => $values) { try { $processor = $this->akeneoAttributeProcessorProvider->getProcessor((string) $attributeCode, [ diff --git a/src/Task/Product/CreateSimpleProductEntitiesTask.php b/src/Task/Product/CreateSimpleProductEntitiesTask.php index 6746f6ea..28658f41 100644 --- a/src/Task/Product/CreateSimpleProductEntitiesTask.php +++ b/src/Task/Product/CreateSimpleProductEntitiesTask.php @@ -175,7 +175,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->linkCategoriesToProduct($payload, $product, $resource['categories']); $productResourcePayload = $this->insertAttributesToProduct($payload, $product, $resource['family'], $resource); - if ($productResourcePayload->getProduct() === null) { + if (null === $productResourcePayload->getProduct()) { continue; } @@ -275,10 +275,10 @@ private function updateProductRequirementsForActiveLocales( $productTranslation->setName($productName); - if ($product->getId() !== null && - $productTranslation->getSlug() !== null && - $this->productConfiguration !== null && - $this->productConfiguration->getRegenerateUrlRewrites() === false) { + if (null !== $product->getId() && + null !== $productTranslation->getSlug() && + null !== $this->productConfiguration && + false === $this->productConfiguration->getRegenerateUrlRewrites()) { // no regenerate slug if config disable it continue; diff --git a/src/Task/Product/InsertProductImagesTask.php b/src/Task/Product/InsertProductImagesTask.php index 74a02bee..b2aab11d 100644 --- a/src/Task/Product/InsertProductImagesTask.php +++ b/src/Task/Product/InsertProductImagesTask.php @@ -29,7 +29,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->cleanImages($product); $imageAttributes = $payload->getProductConfiguration()->getAkeneoImageAttributes(); - if ($imageAttributes === null) { + if (null === $imageAttributes) { $this->logger->warning(Messages::noConfigurationSet('at least one Akeneo image attribute', 'Import image')); return $payload; diff --git a/src/Task/Product/InsertProductVariantImagesTask.php b/src/Task/Product/InsertProductVariantImagesTask.php index d8894610..c03053e0 100644 --- a/src/Task/Product/InsertProductVariantImagesTask.php +++ b/src/Task/Product/InsertProductVariantImagesTask.php @@ -38,7 +38,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $imageAttributes = $this->configuration->getAkeneoImageAttributes(); - if ($imageAttributes === null) { + if (null === $imageAttributes) { return $payload; } diff --git a/src/Task/Product/RetrieveProductsTask.php b/src/Task/Product/RetrieveProductsTask.php index 42a71e76..553ce956 100644 --- a/src/Task/Product/RetrieveProductsTask.php +++ b/src/Task/Product/RetrieveProductsTask.php @@ -80,7 +80,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte ); $stmt = $this->entityManager->getConnection()->prepare($sql); $stmt->bindValue('values', \json_encode($item)); - $stmt->bindValue('is_simple', $item['parent'] === null, ParameterType::BOOLEAN); + $stmt->bindValue('is_simple', null === $item['parent'], ParameterType::BOOLEAN); $stmt->execute(); ++$itemCount; diff --git a/src/Task/ProductModel/AddOrUpdateProductModelTask.php b/src/Task/ProductModel/AddOrUpdateProductModelTask.php index 0283074e..f8579f1c 100644 --- a/src/Task/ProductModel/AddOrUpdateProductModelTask.php +++ b/src/Task/ProductModel/AddOrUpdateProductModelTask.php @@ -360,10 +360,10 @@ private function updateProductRequirementsForActiveLocales( /** @var ProductConfiguration $configuration */ $configuration = $this->productConfigurationRepository->findOneBy([]); - if ($product->getId() !== null && - $configuration !== null && - $productTranslation->getSlug() !== null && - $configuration->getRegenerateUrlRewrites() === false) { + if (null !== $product->getId() && + null !== $configuration && + null !== $productTranslation->getSlug() && + false === $configuration->getRegenerateUrlRewrites()) { // no regenerate slug if config disable it continue; @@ -406,7 +406,7 @@ private function addProductGroup(array &$resource, ProductInterface $product): v { $productGroup = $this->productGroupRepository->findOneBy(['productParent' => $resource['parent']]); - if ($productGroup instanceof ProductGroup && $this->productGroupRepository->isProductInProductGroup($product, $productGroup) === 0) { + if ($productGroup instanceof ProductGroup && 0 === $this->productGroupRepository->isProductInProductGroup($product, $productGroup)) { $productGroup->addProduct($product); } } diff --git a/src/Task/ProductModel/AddProductGroupsTask.php b/src/Task/ProductModel/AddProductGroupsTask.php index a4617fb3..0fe71c27 100644 --- a/src/Task/ProductModel/AddProductGroupsTask.php +++ b/src/Task/ProductModel/AddProductGroupsTask.php @@ -117,10 +117,10 @@ private function createGroupForCode(string $code): void private function createProductGroups(array $resource): void { - if ($resource['parent'] !== null) { + if (null !== $resource['parent']) { $this->createGroupForCode($resource['parent']); } - if ($resource['code'] !== null) { + if (null !== $resource['code']) { $this->createGroupForCode($resource['code']); } } diff --git a/src/Task/ProductModel/RetrieveProductModelsTask.php b/src/Task/ProductModel/RetrieveProductModelsTask.php index 81c9957d..cda9e683 100644 --- a/src/Task/ProductModel/RetrieveProductModelsTask.php +++ b/src/Task/ProductModel/RetrieveProductModelsTask.php @@ -81,8 +81,6 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->logger->warning(Messages::noCodeToImport($payload->getType(), $noCodeCount)); } - $payload = new ProductModelPayload($payload->getAkeneoPimClient()); - - return $payload; + return new ProductModelPayload($payload->getAkeneoPimClient()); } } diff --git a/src/Transformer/AkeneoAttributeToSyliusAttributeTransformer.php b/src/Transformer/AkeneoAttributeToSyliusAttributeTransformer.php index c86695a5..5333e7dd 100644 --- a/src/Transformer/AkeneoAttributeToSyliusAttributeTransformer.php +++ b/src/Transformer/AkeneoAttributeToSyliusAttributeTransformer.php @@ -28,7 +28,7 @@ public function transform(string $attribute): string /** @var AttributeAkeneoSyliusMapping $attributeAkeneoSyliusMapping */ foreach ($this->attributeAkeneoSyliusMappings as $attributeAkeneoSyliusMapping) { - if ($attributeAkeneoSyliusMapping->getAkeneoAttribute() !== $attribute || $attributeAkeneoSyliusMapping->getSyliusAttribute() === null) { + if ($attributeAkeneoSyliusMapping->getAkeneoAttribute() !== $attribute || null === $attributeAkeneoSyliusMapping->getSyliusAttribute()) { continue; } $attribute = $attributeAkeneoSyliusMapping->getSyliusAttribute(); diff --git a/src/TypeMatcher/Attribute/MetricAttributeTypeMatcher.php b/src/TypeMatcher/Attribute/MetricAttributeTypeMatcher.php index 2fb7a5c3..a75d35ac 100644 --- a/src/TypeMatcher/Attribute/MetricAttributeTypeMatcher.php +++ b/src/TypeMatcher/Attribute/MetricAttributeTypeMatcher.php @@ -18,7 +18,7 @@ public function getType(): string public function support(string $akeneoType): bool { - return $akeneoType === self::SUPPORTED_TYPE; + return self::SUPPORTED_TYPE === $akeneoType; } public function getBuilder(): string diff --git a/tests/PHPUnit/Api/ApiTestCase.php b/tests/PHPUnit/Api/ApiTestCase.php index 74cf49da..4eed0a23 100644 --- a/tests/PHPUnit/Api/ApiTestCase.php +++ b/tests/PHPUnit/Api/ApiTestCase.php @@ -93,11 +93,11 @@ protected function getFileContent(string $name): string protected function getAuthenticatedJson(): string { - return <<addExcludeFamily('shoes') ->addLocale('en_US') ->setUpdatedAfter(new \DateTime('2020-04-04')) - ->setUpdatedBefore(new \DateTime('2020-04-04')); + ->setUpdatedBefore(new \DateTime('2020-04-04')) + ; $this->manager->flush(); } diff --git a/tests/PHPUnit/Task/Product/CreateSimpleProductEntitiesTaskTest.php b/tests/PHPUnit/Task/Product/CreateSimpleProductEntitiesTaskTest.php index e99185f1..0e7d7084 100644 --- a/tests/PHPUnit/Task/Product/CreateSimpleProductEntitiesTaskTest.php +++ b/tests/PHPUnit/Task/Product/CreateSimpleProductEntitiesTaskTest.php @@ -27,6 +27,10 @@ use Synolia\SyliusAkeneoPlugin\Task\Product\RetrieveProductsTask; use Synolia\SyliusAkeneoPlugin\Task\Product\SetupProductTask; +/** + * @internal + * @coversNothing + */ final class CreateSimpleProductEntitiesTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ @@ -191,15 +195,15 @@ public function testCreateSimpleProductsWithMultiSelectCheckboxTask( $this->assertNotEmpty($product->getAttributes()); foreach ($product->getAttributes() as $attribute) { - if ($attribute->getCode() === 'maximum_print_size') { + if ('maximum_print_size' === $attribute->getCode()) { $this->assertCount(1, $attribute->getValue()); $this->assertEquals($selectValue, $attribute->getValue()[0]); } - if ($attribute->getCode() === 'multifunctional_functions') { + if ('multifunctional_functions' === $attribute->getCode()) { $this->assertGreaterThanOrEqual(1, $attribute->getValue()); $this->assertEquals($multiSelectValue, $attribute->getValue()); } - if ($attribute->getCode() === 'color_scanning') { + if ('color_scanning' === $attribute->getCode()) { $this->assertEquals($checkboxValue, $attribute->getValue()); } } diff --git a/tests/PHPUnit/Task/Product/EnableDisableProductTaskTest.php b/tests/PHPUnit/Task/Product/EnableDisableProductTaskTest.php index 96616c66..103cfb80 100644 --- a/tests/PHPUnit/Task/Product/EnableDisableProductTaskTest.php +++ b/tests/PHPUnit/Task/Product/EnableDisableProductTaskTest.php @@ -4,8 +4,6 @@ namespace Tests\Synolia\SyliusAkeneoPlugin\PHPUnit\Task\Product; -use Sylius\Component\Core\Model\Channel; -use Sylius\Component\Core\Model\Product; use Sylius\Component\Core\Model\Taxon; use Sylius\Component\Core\Model\TaxonInterface; use Synolia\SyliusAkeneoPlugin\Payload\Attribute\AttributePayload; @@ -18,6 +16,10 @@ use Synolia\SyliusAkeneoPlugin\Task\Product\RetrieveProductsTask; use Synolia\SyliusAkeneoPlugin\Task\Product\SetupProductTask; +/** + * @internal + * @coversNothing + */ final class EnableDisableProductTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ diff --git a/tests/PHPUnit/Task/Product/RetrieveProductTaskTest.php b/tests/PHPUnit/Task/Product/RetrieveProductTaskTest.php index 7ef812f9..631c967d 100644 --- a/tests/PHPUnit/Task/Product/RetrieveProductTaskTest.php +++ b/tests/PHPUnit/Task/Product/RetrieveProductTaskTest.php @@ -8,6 +8,10 @@ use Synolia\SyliusAkeneoPlugin\Provider\AkeneoTaskProvider; use Synolia\SyliusAkeneoPlugin\Task\Product\RetrieveProductsTask; +/** + * @internal + * @coversNothing + */ final class RetrieveProductTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ diff --git a/tests/PHPUnit/Task/ProductModel/AddFamilyVariationAxeTaskTest.php b/tests/PHPUnit/Task/ProductModel/AddFamilyVariationAxeTaskTest.php index 084f2134..c9c7ae30 100644 --- a/tests/PHPUnit/Task/ProductModel/AddFamilyVariationAxeTaskTest.php +++ b/tests/PHPUnit/Task/ProductModel/AddFamilyVariationAxeTaskTest.php @@ -20,6 +20,10 @@ use Synolia\SyliusAkeneoPlugin\Task\ProductModel\RetrieveProductModelsTask; use Synolia\SyliusAkeneoPlugin\Task\ProductModel\SetupProductTask; +/** + * @internal + * @coversNothing + */ final class AddFamilyVariationAxeTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ diff --git a/tests/PHPUnit/Task/ProductModel/AddOrUpdateProductModelTaskTest.php b/tests/PHPUnit/Task/ProductModel/AddOrUpdateProductModelTaskTest.php index f53af678..d432aea5 100644 --- a/tests/PHPUnit/Task/ProductModel/AddOrUpdateProductModelTaskTest.php +++ b/tests/PHPUnit/Task/ProductModel/AddOrUpdateProductModelTaskTest.php @@ -20,6 +20,10 @@ use Synolia\SyliusAkeneoPlugin\Task\ProductModel\RetrieveProductModelsTask; use Synolia\SyliusAkeneoPlugin\Task\ProductModel\SetupProductTask; +/** + * @internal + * @coversNothing + */ final class AddOrUpdateProductModelTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ @@ -65,7 +69,7 @@ public function testCreateUpdateTask(): void foreach ($results as $result) { $resource = \json_decode($result['values'], true); - if ($resource['parent'] === null) { + if (null === $resource['parent']) { continue; } $productBase = $resource; diff --git a/tests/PHPUnit/Task/ProductModel/EnableDisableProductModelTaskTest.php b/tests/PHPUnit/Task/ProductModel/EnableDisableProductModelTaskTest.php index b37313c4..b26b1b17 100644 --- a/tests/PHPUnit/Task/ProductModel/EnableDisableProductModelTaskTest.php +++ b/tests/PHPUnit/Task/ProductModel/EnableDisableProductModelTaskTest.php @@ -13,6 +13,10 @@ use Synolia\SyliusAkeneoPlugin\Task\ProductModel\RetrieveProductModelsTask; use Synolia\SyliusAkeneoPlugin\Task\ProductModel\SetupProductTask; +/** + * @internal + * @coversNothing + */ final class EnableDisableProductModelTaskTest extends AbstractTaskTest { /** @var AkeneoTaskProvider */ @@ -50,7 +54,7 @@ public function testEnableDisableProductModelTask(): void foreach ($results as $result) { $resource = \json_decode($result['values'], true); - if ($resource['parent'] === null) { + if (null === $resource['parent']) { continue; } $productBase = $resource; diff --git a/tests/PHPUnit/Task/ProductModel/RetrieveProductModelTaskTest.php b/tests/PHPUnit/Task/ProductModel/RetrieveProductModelTaskTest.php index 5e3a4330..521bbbd9 100644 --- a/tests/PHPUnit/Task/ProductModel/RetrieveProductModelTaskTest.php +++ b/tests/PHPUnit/Task/ProductModel/RetrieveProductModelTaskTest.php @@ -8,6 +8,10 @@ use Synolia\SyliusAkeneoPlugin\Provider\AkeneoTaskProvider; use Synolia\SyliusAkeneoPlugin\Task\ProductModel\RetrieveProductModelsTask; +/** + * @internal + * @coversNothing + */ final class RetrieveProductModelTaskTest extends AbstractTaskTest { private const NUMBER_OF_IMPORTED_MODELS = 3; diff --git a/tests/PHPUnit/Task/ProductOption/CreateUpdateTaskTest.php b/tests/PHPUnit/Task/ProductOption/CreateUpdateTaskTest.php index 7b23f452..889fa93e 100644 --- a/tests/PHPUnit/Task/ProductOption/CreateUpdateTaskTest.php +++ b/tests/PHPUnit/Task/ProductOption/CreateUpdateTaskTest.php @@ -18,6 +18,10 @@ use Synolia\SyliusAkeneoPlugin\Task\AttributeOption\RetrieveOptionsTask; use Synolia\SyliusAkeneoPlugin\Task\Option\CreateUpdateTask; +/** + * @internal + * @coversNothing + */ final class CreateUpdateTaskTest extends AbstractTaskTest { /** @var \Synolia\SyliusAkeneoPlugin\Provider\AkeneoTaskProvider */ diff --git a/tests/PHPUnit/Task/ProductOption/DeleteTaskTest.php b/tests/PHPUnit/Task/ProductOption/DeleteTaskTest.php index ee92299a..4a1893a7 100644 --- a/tests/PHPUnit/Task/ProductOption/DeleteTaskTest.php +++ b/tests/PHPUnit/Task/ProductOption/DeleteTaskTest.php @@ -10,6 +10,10 @@ use Synolia\SyliusAkeneoPlugin\Provider\AkeneoTaskProvider; use Synolia\SyliusAkeneoPlugin\Task\Option\DeleteTask; +/** + * @internal + * @coversNothing + */ final class DeleteTaskTest extends AbstractTaskTest { /** @var \Synolia\SyliusAkeneoPlugin\Provider\AkeneoTaskProvider */ diff --git a/tests/PHPUnit/Transformer/AkeneoAttributeToSyliusAttributeTransformerTest.php b/tests/PHPUnit/Transformer/AkeneoAttributeToSyliusAttributeTransformerTest.php index cbc12ac8..56dd0e38 100644 --- a/tests/PHPUnit/Transformer/AkeneoAttributeToSyliusAttributeTransformerTest.php +++ b/tests/PHPUnit/Transformer/AkeneoAttributeToSyliusAttributeTransformerTest.php @@ -9,6 +9,10 @@ use Synolia\SyliusAkeneoPlugin\Entity\AttributeAkeneoSyliusMapping; use Synolia\SyliusAkeneoPlugin\Transformer\AkeneoAttributeToSyliusAttributeTransformer; +/** + * @internal + * @coversNothing + */ final class AkeneoAttributeToSyliusAttributeTransformerTest extends KernelTestCase { /** @var AkeneoAttributeToSyliusAttributeTransformer */ diff --git a/tests/PHPUnit/TypeMatcher/Attribute/AttributeTypeMatcherTest.php b/tests/PHPUnit/TypeMatcher/Attribute/AttributeTypeMatcherTest.php index 6c48da08..496a950b 100644 --- a/tests/PHPUnit/TypeMatcher/Attribute/AttributeTypeMatcherTest.php +++ b/tests/PHPUnit/TypeMatcher/Attribute/AttributeTypeMatcherTest.php @@ -19,6 +19,10 @@ use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\TextareaAttributeTypeMatcher; use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\TextAttributeTypeMatcher; +/** + * @internal + * @coversNothing + */ final class AttributeTypeMatcherTest extends KernelTestCase { private const FAKE_AKENEO_ATTRIBUTE_TYPE = 'my_fake_attribute_type';