Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versionnement d'un patch #4

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Async/ImportProductProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ public function __construct(
$this->syncProcessorRegistry = $syncProcessorRegistry;
}

/**
* {@inheritdoc}
*/
public static function getSubscribedTopics()
{
return [Topics::IMPORT_PRODUCTS];
}

/**
* {@inheritdoc}
*/
public function process(MessageInterface $message, SessionInterface $session)
{
$body = JSON::decode($message->getBody());
Expand Down
4 changes: 2 additions & 2 deletions Client/AkeneoClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Akeneo\Pim\ApiClient\AkeneoPimClientInterface;
use Akeneo\Pim\ApiClient\Api\AssetApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetApiInterface as AssetManagerApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetCategoryApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetApiInterface as AssetManagerApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetAttributeApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetAttributeOptionApiInterface;
use Akeneo\Pim\ApiClient\Api\AssetManager\AssetFamilyApiInterface;
Expand Down Expand Up @@ -40,7 +40,6 @@

class AkeneoClient implements AkeneoPimClientInterface
{
/** @var AkeneoPimClientInterface */
protected AkeneoPimClientInterface $decoratedClient;

/** @var ApiAwareInterface[] */
Expand Down Expand Up @@ -68,6 +67,7 @@ public function __call($name, $arguments)
if ('get' === substr($name, 0, 3) && isset($this->apiRegistry[$property])) {
return $this->apiRegistry[$property];
}

return $this->decoratedClient->{$name}($arguments);
}

Expand Down
9 changes: 2 additions & 7 deletions Client/AkeneoClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class AkeneoClientBuilder extends AkeneoPimClientBuilder
*/
protected array $apiRegistry = [];

/**
* @param ApiAwareInterface|null ...$apis
*/
public function __construct(?ApiAwareInterface ...$apis)
{
foreach ($apis as $api) {
Expand All @@ -25,12 +22,12 @@ public function __construct(?ApiAwareInterface ...$apis)
}

/**
* @param string $baseUri
* @return $this
*/
public function setBaseUri(string $baseUri): AkeneoClientBuilder
{
$this->baseUri = $baseUri;

return $this;
}

Expand All @@ -40,9 +37,6 @@ public function addApi(ApiAwareInterface $api): void
$this->apiRegistry[$shortClass] = $api;
}

/**
* @inheritDoc
*/
protected function buildAuthenticatedClient(Authentication $authentication): AkeneoPimClientInterface
{
list($resourceClient, $pageFactory, $cursorFactory, $fileSystem) = parent::setUp($authentication);
Expand All @@ -58,6 +52,7 @@ protected function buildAuthenticatedClient(Authentication $authentication): Ake
;
$client->addApi($key, $api);
}

return $client;
}
}
16 changes: 0 additions & 16 deletions Client/Api/ApiAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,11 @@

interface ApiAwareInterface
{
/**
* @param ResourceClientInterface $resourceClient
* @return ApiAwareInterface
*/
public function setResourceClient(ResourceClientInterface $resourceClient): ApiAwareInterface;

/**
* @param PageFactoryInterface $pageFactory
* @return ApiAwareInterface
*/
public function setPageFactory(PageFactoryInterface $pageFactory): ApiAwareInterface;

/**
* @param ResourceCursorFactoryInterface $cursorFactory
* @return ApiAwareInterface
*/
public function setCursorFactory(ResourceCursorFactoryInterface $cursorFactory): ApiAwareInterface;

/**
* @param FileSystemInterface $fileSystem
* @return ApiAwareInterface
*/
public function setFileSystem(FileSystemInterface $fileSystem): ApiAwareInterface;
}
16 changes: 4 additions & 12 deletions Client/Api/ApiAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,31 @@ trait ApiAwareTrait
/** @var FileSystemInterface */
protected $fileSystem;

/**
* @inheritDoc
*/
public function setResourceClient(ResourceClientInterface $resourceClient): ApiAwareInterface
{
$this->resourceClient = $resourceClient;

return $this;
}

/**
* @inheritDoc
*/
public function setPageFactory(PageFactoryInterface $pageFactory): ApiAwareInterface
{
$this->pageFactory = $pageFactory;

return $this;
}

/**
* @inheritDoc
*/
public function setCursorFactory(ResourceCursorFactoryInterface $cursorFactory): ApiAwareInterface
{
$this->cursorFactory = $cursorFactory;

return $this;
}

/**
* @inheritDoc
*/
public function setFileSystem(FileSystemInterface $fileSystem): ApiAwareInterface
{
$this->fileSystem = $fileSystem;

return $this;
}
}
4 changes: 2 additions & 2 deletions Command/CleanupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ private function deleteRecords(): int
$iterator = new BufferedIdentityQueryResultIterator($jqb->getQuery());

$result = 0;
$iterator->setPageLoadedCallback(function (array $rows) use ($qb, &$result): array {
$iterator->setPageLoadedCallback(static function (array $rows) use ($qb, &$result): array {
$ids = array_column($rows, 'id');

$result = $result + $qb->setParameter('ids', $ids)->getQuery()->execute();
$result += $qb->setParameter('ids', $ids)->getQuery()->execute();

return $ids;
});
Expand Down
2 changes: 1 addition & 1 deletion Controller/ValidateConnectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
*
* @throws \InvalidArgumentException
*/
public function validateConnectionAction(Request $request, Channel $channel = null): JsonResponse
public function validateConnectionAction(Request $request, ?Channel $channel = null): JsonResponse
{
if (!$channel) {
$channel = new Channel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

class AdditionalApiCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
$definition = $container->getDefinition('oro_akeneo.client_builder');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class AdditionalOptionalListenersCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
$listeners = array_keys(
Expand Down
3 changes: 0 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder(OroAkeneoExtension::ALIAS);
Expand Down
6 changes: 0 additions & 6 deletions DependencyInjection/OroAkeneoExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class OroAkeneoExtension extends Extension
{
const ALIAS = 'oro_akeneo';

/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$config = $this->processConfiguration(new Configuration(), $configs);
Expand All @@ -34,9 +31,6 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('form_types.yml');
}

/**
* {@inheritdoc}
*/
public function getAlias()
{
return self::ALIAS;
Expand Down
2 changes: 1 addition & 1 deletion Entity/AkeneoLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function getAkeneoSettings()
return $this->akeneoSettings;
}

public function setAkeneoSettings(AkeneoSettings $akeneoSettings = null): self
public function setAkeneoSettings(?AkeneoSettings $akeneoSettings = null): self
{
$this->akeneoSettings = $akeneoSettings;

Expand Down
37 changes: 8 additions & 29 deletions Entity/AkeneoSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function getAkeneoChannels()
*
* @return self
*/
public function setAkeneoChannels(array $akeneoChannels = null)
public function setAkeneoChannels(?array $akeneoChannels = null)
{
$this->akeneoChannels = $akeneoChannels;

Expand Down Expand Up @@ -472,9 +472,6 @@ public function setPassword($password)
return $this;
}

/**
* @return string
*/
public function getToken(): ?string
{
return $this->token;
Expand All @@ -485,9 +482,6 @@ public function setToken(string $token): void
$this->token = $token;
}

/**
* @return string
*/
public function getRefreshToken(): ?string
{
return $this->refreshToken;
Expand Down Expand Up @@ -571,7 +565,7 @@ public function getAkeneoCurrencies()
*
* @return self
*/
public function setAkeneoCurrencies(array $akeneoCurrencies = null)
public function setAkeneoCurrencies(?array $akeneoCurrencies = null)
{
$this->akeneoCurrencies = $akeneoCurrencies;

Expand All @@ -593,7 +587,7 @@ public function getAkeneoActiveCurrencies()
*
* @return self
*/
public function setAkeneoActiveCurrencies(array $akeneoActiveCurrencies = null)
public function setAkeneoActiveCurrencies(?array $akeneoActiveCurrencies = null)
{
$this->akeneoActiveCurrencies = $akeneoActiveCurrencies;

Expand Down Expand Up @@ -623,7 +617,7 @@ public function getAkeneoLocalesList()
*
* @return self
*/
public function setAkeneoLocalesList(array $akeneoLocalesList = null)
public function setAkeneoLocalesList(?array $akeneoLocalesList = null)
{
$this->akeneoLocalesList = $akeneoLocalesList;

Expand All @@ -635,10 +629,7 @@ public function getAkeneoAttributesImageList(): ?string
return $this->akeneoAttributesImageList;
}

/**
* @param string $akeneoAttributesImageList
*/
public function setAkeneoAttributesImageList(string $akeneoAttributesImageList = null): self
public function setAkeneoAttributesImageList(?string $akeneoAttributesImageList = null): self
{
$this->akeneoAttributesImageList = $akeneoAttributesImageList;

Expand Down Expand Up @@ -677,7 +668,7 @@ public function getRootCategory()
*
* @return AkeneoSettings
*/
public function setRootCategory(Category $rootCategory = null)
public function setRootCategory(?Category $rootCategory = null)
{
$this->rootCategory = $rootCategory;

Expand Down Expand Up @@ -720,9 +711,6 @@ public function setAclVoterEnabled($aclVoterEnabled)
return $this;
}

/**
* @return PriceList
*/
public function getPriceList(): ?PriceList
{
return $this->priceList;
Expand All @@ -740,19 +728,13 @@ public function getAkeneoAttributesList(): ?string
return $this->akeneoAttributesList;
}

/**
* @param string $attributeList
*/
public function setAkeneoAttributesList(string $attributeList = null): self
public function setAkeneoAttributesList(?string $attributeList = null): self
{
$this->akeneoAttributesList = $attributeList;

return $this;
}

/**
* @return bool
*/
public function isAkeneoMergeImageToParent(): ?bool
{
return $this->akeneoMergeImageToParent;
Expand Down Expand Up @@ -812,16 +794,13 @@ public function setAkeneoBrandMapping(?string $akeneoBrandMapping): void
$this->akeneoBrandMapping = $akeneoBrandMapping;
}

public function setAlternativeIdentifier(string $alternativeIdentifier = null)
public function setAlternativeIdentifier(?string $alternativeIdentifier = null)
{
$this->alternativeIdentifier = $alternativeIdentifier;

return $this;
}

/**
* @return string|null
*/
public function getAlternativeIdentifier(): ?string
{
return $this->alternativeIdentifier;
Expand Down
3 changes: 0 additions & 3 deletions EventListener/ImportExportTagsSubscriberDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ function (TagImportManager $tagImportManager) {
)($tagImportManager);
}

/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return ImportExportTagsSubscriber::getSubscribedEvents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
/**
* Postpone segments updates
*/
class ProductCollectionVariantReindexMessageSendListenerDecorator extends BaseListener implements
AdditionalOptionalListenerInterface
class ProductCollectionVariantReindexMessageSendListenerDecorator extends BaseListener implements AdditionalOptionalListenerInterface
{
use AdditionalOptionalListenerTrait;

Expand Down
1 change: 0 additions & 1 deletion EventSubscriber/DoctrineSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class DoctrineSubscriber implements EventSubscriber, ContainerAwareInterface
{
use ContainerAwareTrait;

/** {@inheritdoc} */
public function getSubscribedEvents()
{
return [
Expand Down
Loading
Loading