Skip to content

Commit

Permalink
Merge pull request #194 from synolia/feature/v4
Browse files Browse the repository at this point in the history
v4 features
  • Loading branch information
oallain authored Dec 9, 2024
2 parents c87a80d + b1ab481 commit 6f028a5
Show file tree
Hide file tree
Showing 200 changed files with 3,537 additions and 2,393 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
matrix:
php:
- 8.2
- 8.3
symfony:
- '5.4.*'
- '6.2.*'
- '6.4.*'
env:
APP_ENV: test
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ jobs:
matrix:
php:
- 8.2
- 8.3
sylius:
- 1.12.0
symfony:
- 5.4
- 6.2
- 6.4
node:
- 14.x
env:
Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@
"description": "Akeneo connector for Sylius.",
"license": "EUPL-1.2",
"require": {
"php": "^8.0",
"php": "^8.2",
"ext-json": "*",
"akeneo/api-php-client": ">=8.0 <12.0",
"behat/transliterator": "^1.3",
"bluepsyduck/symfony-process-manager": "^1.3",
"doctrine/dbal": "^2.10 || ^3.0",
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
"http-interop/http-factory-guzzle": "^1.0",
"http-interop/http-factory-guzzle": "^1.2",
"league/pipeline": "^1.0",
"php-http/guzzle6-adapter": "^2.0",
"psr/event-dispatcher": "^1.0",
"sylius/sylius": "^1.10",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/lock": "^5.4|^6.0",
"symfony/property-access": "^4.3|^5.4|^6.0",
"symfony/property-info": "^5.4|^6.0",
"symfony/serializer": "^5.4|^6.0",
"symfony/framework-bundle": "^6.0",
"symfony/lock": "^6.0",
"symfony/property-access": "^6.0",
"symfony/property-info": "^6.0",
"symfony/serializer": "^6.0",
"symfony/service-contracts": "^1.1|^2.0|^3.0",
"webmozart/assert": "^1.8"
},
Expand Down Expand Up @@ -67,7 +66,7 @@
},
"extra": {
"symfony": {
"require": "^5.4 || ^6.0"
"require": "^6.0"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion install/Application/config/packages/test/akeneo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
Synolia\SyliusAkeneoPlugin\Factory\ProductModelPipelineFactory: ~
Synolia\SyliusAkeneoPlugin\Factory\AssociationTypePipelineFactory: ~
Synolia\SyliusAkeneoPlugin\Filter\ProductFilter: ~
Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider: ~
Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProvider: ~
Synolia\SyliusAkeneoPlugin\Provider\TaskProvider: ~
Synolia\SyliusAkeneoPlugin\Retriever\FamilyRetriever: ~
Synolia\SyliusAkeneoPlugin\Repository\ProductAttributeRepository: ~
Expand Down
530 changes: 195 additions & 335 deletions ruleset/phpstan-baseline.neon

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ruleset/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ parameters:
- '#Call to an undefined method League\\Pipeline\\PipelineInterface\:\:process\(\).#'
- '#Method Doctrine\\Persistence\\ObjectRepository<object>\:\:findOneBy\(\) invoked with 2 parameters, 1 required.#'
- "#^Call to an undefined method Symfony\\\\Component\\\\HttpFoundation\\\\Session\\\\SessionInterface\\:\\:getFlashBag\\(\\)\\.$#"
-
message: '#Property [a-zA-Z0-9\\_]+::\$pipelineFactory is never read, only written.#'
path: ../src/Command/*
4 changes: 2 additions & 2 deletions src/Builder/Attribute/AssetAttributeValueValueBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AssetCollectionAttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;

final class AssetAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\BooleanAttributeTypeMatcher;

final class BooleanProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\CollectionReferenceEntityAttributeTypeMatcher;

final class CollectionReferenceEntityAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\DatabaseMappingAttributeTypeMatcher;

final class DatabaseProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
private DatabaseMappingAttributeTypeMatcher $databaseMappingAttributeTypeMatcher,
private ProductAttributeValueValueBuilder $productAttributeValueValueBuilder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
use DateTime;
use DateTimeInterface;
use LogicException;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\DateAttributeTypeMatcher;

final class DateProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\IntegerAttributeTypeMatcher;

final class IntegerProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\MetricAttributeTypeMatcher;

final class MetricProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Transformer\AttributeOptionValueDataTransformerInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\MultiSelectAttributeTypeMatcher;

final class MultiSelectProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
private AttributeOptionValueDataTransformerInterface $attributeOptionValueDataTransformer,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function hasSupportedBuilder(string $attributeCode): bool
return true;
}
} catch (Throwable $throwable) {
$this->akeneoLogger->critical(sprintf(
$this->akeneoLogger->error(sprintf(
'AttributeValueBuilder "%s" failed to execute method support() for attribute "%s"',
$attributeValueBuilder::class,
$attributeCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingLocaleTranslationOrScopeException;
use Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\MissingScopeException;
use Synolia\SyliusAkeneoPlugin\Exceptions\Attribute\TranslationNotFoundException;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoReferenceEntityAttributeDataProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoReferenceEntityAttributeDataProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\ProductRefEntityAttributeValueValueBuilderProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\ReferenceEntityAttributeTypeMatcher;
Expand All @@ -21,7 +21,7 @@
final class ReferenceEntityAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AkeneoReferenceEntityAttributeDataProviderInterface $akeneoReferenceEntityAttributeDataProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
private AkeneoPimClientInterface $client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Transformer\AttributeOptionValueDataTransformerInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\SelectAttributeTypeMatcher;

final class SelectProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
private AttributeOptionValueDataTransformerInterface $attributeOptionValueDataTransformer,
) {
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/Attribute/TableAttributeValueValueBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
use Sylius\Component\Product\Model\ProductAttributeInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Synolia\SyliusAkeneoPlugin\Exceptions\Processor\MissingAkeneoProductAttributeValueProcessorException;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\ProductAttributeValue\TableAttributeValueProcessorProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\TableAttributeTypeMatcher;

final class TableAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
private RepositoryInterface $productAttributeRepository,
private TableAttributeValueProcessorProviderInterface $tableAttributeValueProcessorProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Synolia\SyliusAkeneoPlugin\Builder\Attribute;

use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\TextareaAttributeTypeMatcher;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\TextAttributeTypeMatcher;

final class TextProductAttributeValueValueBuilder implements ProductAttributeValueValueBuilderInterface
{
public function __construct(
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AttributeTypeMatcher $attributeTypeMatcher,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Synolia\SyliusAkeneoPlugin\Event\ProductOptionValueTranslation\AfterProcessingProductOptionValueTranslationEvent;
use Synolia\SyliusAkeneoPlugin\Event\ProductOptionValueTranslation\BeforeProcessingProductOptionValueTranslationEvent;
use Synolia\SyliusAkeneoPlugin\Exceptions\Builder\ProductOptionValueTranslation\ProductOptionValueTranslationBuilderNotFoundException;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\SyliusAkeneoLocaleCodeProvider;
use Synolia\SyliusAkeneoPlugin\Transformer\ProductOptionValueDataTransformerInterface;
use Webmozart\Assert\Assert;
Expand All @@ -29,7 +29,7 @@ public static function getDefaultPriority(): int
public function __construct(
private FactoryInterface $productOptionValueFactory,
private SyliusAkeneoLocaleCodeProvider $syliusAkeneoLocaleCodeProvider,
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private ProductOptionValueDataTransformerInterface $productOptionValueDataTransformer,
private ProductOptionValueTranslationBuilderProcessorInterface $productOptionValueTranslationBuilder,
private LoggerInterface $akeneoLogger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Synolia\SyliusAkeneoPlugin\Exceptions\Retriever\FamilyMeasureNotFoundException;
use Synolia\SyliusAkeneoPlugin\Exceptions\Retriever\MeasurableNotFoundException;
use Synolia\SyliusAkeneoPlugin\Exceptions\UnsupportedAttributeTypeException;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributeDataProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\AkeneoAttributePropertiesProvider;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributeDataProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\Data\AkeneoAttributePropertiesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Provider\ProductFilterRulesProviderInterface;
use Synolia\SyliusAkeneoPlugin\Retriever\FamilyMeasureRetriever;
use Synolia\SyliusAkeneoPlugin\TypeMatcher\Attribute\AttributeTypeMatcher;
Expand All @@ -29,7 +29,7 @@ class MetricProductOptionValueTranslationBuilder implements ProductOptionValueTr

public function __construct(
private AttributeTypeMatcher $attributeTypeMatcher,
private AkeneoAttributePropertiesProvider $akeneoAttributePropertiesProvider,
private AkeneoAttributePropertiesProviderInterface $akeneoAttributePropertiesProvider,
private AkeneoAttributeDataProviderInterface $akeneoAttributeDataProvider,
private FamilyMeasureRetriever $measureFamilyRetriever,
private ProductFilterRulesProviderInterface $productFilterRulesProvider,
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/TaxonAttribute/TaxonAttributeValueBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function hasSupportedBuilder(string $attributeCode): bool
return true;
}
} catch (Throwable $throwable) {
$this->akeneoLogger->critical(sprintf(
$this->akeneoLogger->error(sprintf(
'TaxonAttributeValueBuilder "%s" failed to execute method support() for attribute "%s"',
$attributeValueBuilder::class,
$attributeCode,
Expand Down
Loading

0 comments on commit 6f028a5

Please sign in to comment.