Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Jun 12, 2024
1 parent 172f5de commit 62908c7
Show file tree
Hide file tree
Showing 180 changed files with 634 additions and 520 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function validateConnectionData(ConnectionRequest $connectionRequest): Re
{
try {
$this->connectionService->isConnectionDataValid($connectionRequest->transformToDomainModel());
} catch (BadMerchantIdException|InvalidEnvironmentException|WrongCredentialsException|HttpRequestException $e) {
} catch (BadMerchantIdException | InvalidEnvironmentException | WrongCredentialsException | HttpRequestException $e) {
return new ErrorResponse($e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public function __construct(
string $password,
bool $sendStatisticalData,
?string $merchantId = null
)
{
) {
$this->environment = $environment;
$this->merchantId = $merchantId;
$this->username = $username;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class CountryConfigurationController
public function __construct(
CountryConfigurationService $countryConfigurationService,
SellingCountriesService $sellingCountriesService
)
{
) {
$this->countryConfigurationService = $countryConfigurationService;
$this->sellingCountriesService = $sellingCountriesService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ class GeneralSettingsController
* @param CategoryService $categoryService
*/
public function __construct(
GeneralSettingsService $generalSettingsService,
CategoryService $categoryService
)
{
GeneralSettingsService $generalSettingsService,
CategoryService $categoryService
) {
$this->generalSettingsService = $generalSettingsService;
$this->categoryService = $categoryService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public function __construct(
?array $allowedIPAddresses,
?array $excludedProducts,
?array $excludedCategories
)
{
) {
$this->sendOrderReportsPeriodicallyToSeQura = $sendOrderReportsPeriodicallyToSeQura;
$this->showSeQuraCheckoutAsHostedPage = $showSeQuraCheckoutAsHostedPage;
$this->allowedIPAddresses = $allowedIPAddresses;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public function __construct(
VersionService $versionService,
Configuration $configurationService,
UIStateService $stateService
)
{
) {
$this->versionService = $versionService;
$this->configurationService = $configurationService;
$this->stateService = $stateService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ class OrderStatusSettingsController
*/
public function __construct(
OrderStatusSettingsService $orderStatusSettingsService,
ShopOrderStatusesService $shopOrderStatusesService
)
{
ShopOrderStatusesService $shopOrderStatusesService
) {
$this->orderStatusSettingsService = $orderStatusSettingsService;
$this->shopOrderStatusesService = $shopOrderStatusesService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(array $paymentMethods)
/**
* @inheritDoc
*/
public function toArray():array
public function toArray(): array
{
$methods = [];
foreach ($this->paymentMethods as $paymentMethod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function toArray(): array
{
return $this->products;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class PromotionalWidgetsController
*/
public function __construct(
WidgetSettingsService $widgetSettingsService
)
{
) {
$this->widgetSettingsService = $widgetSettingsService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ class WidgetSettingsRequest extends Request
* @param array $messagesBelowLimit
*/
public function __construct(
bool $enabled,
bool $enabled,
?string $assetsKey,
bool $displayOnProductPage,
bool $showInstallmentsInProductListing,
bool $showInstallmentsInCartPage,
string $miniWidgetSelector,
string $widgetConfiguration,
array $messages = [],
array $messagesBelowLimit = []
)
{
bool $displayOnProductPage,
bool $showInstallmentsInProductListing,
bool $showInstallmentsInCartPage,
string $miniWidgetSelector,
string $widgetConfiguration,
array $messages = [],
array $messagesBelowLimit = []
) {
$this->enabled = $enabled;
$this->assetsKey = $assetsKey;
$this->displayOnProductPage = $displayOnProductPage;
Expand Down
5 changes: 3 additions & 2 deletions src/BusinessLogic/AdminAPI/Response/ErrorResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ public function __construct(Throwable $error)

/**
* Implementation is swallowing all undefined calls to avoid undefined method call exceptions when
*
* @see ErrorHandlingAspect already hanled the API call exception but because of chaining calle will trigger
* API controller messages on instance of the @see self.
*
* @param $methodName
* @param $arguments
* @param $methodName
* @param $arguments
* @return self Already handled error response
*/
public function __call($methodName, $arguments)
Expand Down
1 change: 0 additions & 1 deletion src/BusinessLogic/Bootstrap/Aspect/Aspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ interface Aspect
{
public function applyOn(callable $callee, array $params = []);
}

2 changes: 1 addition & 1 deletion src/BusinessLogic/Bootstrap/Aspect/Aspects.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __call($methodName, $arguments)
return $this->aspect->applyOn([$this->subject, $methodName], $arguments);
}

return $this->aspect->applyOn(function() use ($methodName, $arguments) {
return $this->aspect->applyOn(function () use ($methodName, $arguments) {
$subject = ServiceRegister::getService($this->subjectClassName);

return call_user_func_array([$subject, $methodName], $arguments);
Expand Down
4 changes: 3 additions & 1 deletion src/BusinessLogic/BootstrapComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ protected static function initEvents(): void

EventBus::getInstance()->when(TickEvent::class, TickEventListener::class . '::handle');

/** @var QueueItemStateTransitionEventBus $queueBus */
/**
* @var QueueItemStateTransitionEventBus $queueBus
*/
$queueBus = ServiceRegister::getService(QueueItemStateTransitionEventBus::CLASS_NAME);

$queueBus->when(
Expand Down
2 changes: 1 addition & 1 deletion src/BusinessLogic/CheckoutAPI/CheckoutAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function get(): object
}

/**
* @param string $storeId
* @param string $storeId
* @return SolicitationController
*/
public function solicitation(string $storeId): object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SolicitationResponse extends Response

/**
* SolicitationResponse constructor.
*
* @param SeQuraOrder $order
* @param SeQuraPaymentMethod[] $availablePaymentMethods
*/
Expand Down Expand Up @@ -53,7 +54,7 @@ public function toArray(): array
{
return [
'order' => $this->order->toArray(),
'availablePaymentMethods' => array_map(static function(SeQuraPaymentMethod $paymentMethod) {
'availablePaymentMethods' => array_map(static function (SeQuraPaymentMethod $paymentMethod) {
return [
'product' => $paymentMethod->getProduct(),
'title' => $paymentMethod->getTitle(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public function setConnectionData(ConnectionData $connectionData): void
*/
public function getOldestConnectionSettingsStoreId(): ?string
{
/** @var ConnectionDataEntity $connectionData */
/**
* @var ConnectionDataEntity $connectionData
*/
$connectionData = $this->repository->selectOne(new QueryFilter());

return $connectionData ? $connectionData->getStoreId() : null;
Expand All @@ -89,7 +91,9 @@ public function getOldestConnectionSettingsStoreId(): ?string
*/
public function getAllConnectionSettingsStores(): array
{
/** @var ConnectionDataEntity[] $entities */
/**
* @var ConnectionDataEntity[] $entities
*/
$entities = $this->repository->select();

return $entities ? array_map(function ($entity) {
Expand All @@ -110,7 +114,7 @@ protected function getConnectionDataEntity(): ?ConnectionDataEntity
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/**
* @var ConnectionDataEntity $connectionData
* @var ConnectionDataEntity $connectionData
*/
$connectionData = $this->repository->selectOne($queryFilter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ protected function getCountryConfigurationEntity(): ?CountryConfigurationEntity
$queryFilter = new QueryFilter();
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/** @var CountryConfigurationEntity $countryConfiguration */
/**
* @var CountryConfigurationEntity $countryConfiguration
*/
$countryConfiguration = $this->repository->selectOne($queryFilter);

return $countryConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ protected function getGeneralSettingsEntity(): ?GeneralSettingsEntity
$queryFilter = new QueryFilter();
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/** @var GeneralSettingsEntity $generalSettings */
/**
* @var GeneralSettingsEntity $generalSettings
*/
$generalSettings = $this->repository->selectOne($queryFilter);

return $generalSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public function getByShopReference(string $shopOrderReference): ?SeQuraOrder
$filter = new QueryFilter();
$filter->where('orderRef1', Operators::EQUALS, $shopOrderReference);

/** @var SeQuraOrder|null $result */
/**
* @var SeQuraOrder|null $result
*/
$result = $this->repository->selectOne($filter);

return $result;
Expand All @@ -44,7 +46,9 @@ public function getOrderBatchByShopReferences(array $shopOrderReferences): array
$filter = new QueryFilter();
$filter->where('orderRef1', Operators::IN, $shopOrderReferences);

/** @var SeQuraOrder[] $result */
/**
* @var SeQuraOrder[] $result
*/
$result = $this->repository->select($filter);

return $result;
Expand All @@ -55,7 +59,9 @@ public function getByCartId(string $cartId): ?SeQuraOrder
$filter = new QueryFilter();
$filter->where('cartId', Operators::EQUALS, $cartId);

/** @var SeQuraOrder|null $result */
/**
* @var SeQuraOrder|null $result
*/
$result = $this->repository->selectOne($filter);

return $result;
Expand All @@ -66,7 +72,9 @@ public function getByOrderReference(string $sequraOrderReference): ?SeQuraOrder
$filter = new QueryFilter();
$filter->where('reference', Operators::EQUALS, $sequraOrderReference);

/** @var SeQuraOrder|null $result */
/**
* @var SeQuraOrder|null $result
*/
$result = $this->repository->selectOne($filter);

return $result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ protected function getOrderStatusMappingsEntity(): ?OrderStatusSettings
$queryFilter = new QueryFilter();
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/** @noinspection PhpIncompatibleReturnTypeInspection */
/**
* @noinspection PhpIncompatibleReturnTypeInspection
*/
return $this->repository->selectOne($queryFilter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ protected function getWidgetSettingsEntity(): ?WidgetSettingsEntity
$queryFilter = new QueryFilter();
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/** @var WidgetSettingsEntity $widgetSettings */
/**
* @var WidgetSettingsEntity $widgetSettings
*/
$widgetSettings = $this->repository->selectOne($queryFilter);

return $widgetSettings;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public function getReportSendingContexts(): array
$queryFilter = new QueryFilter();
$queryFilter->where('sendReportTime', Operators::LESS_OR_EQUAL_THAN, $now);

/** @var SendReportEntity[] $result */
/**
* @var SendReportEntity[] $result
*/
$result = $this->repository->select($queryFilter);

return $result ? array_map(function ($entity) {
Expand All @@ -128,7 +130,9 @@ protected function getSendReportEntity(?string $context = null): ?SendReportEnti
$queryFilter = new QueryFilter();
$queryFilter->where('context', Operators::EQUALS, $context ?? $this->storeContext->getStoreId());

/** @var SendReportEntity $statisticalData */
/**
* @var SendReportEntity $statisticalData
*/
$statisticalData = $this->repository->selectOne($queryFilter);

return $statisticalData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ protected function getStatisticalDataEntity(): ?StatisticalDataEntity
$queryFilter = new QueryFilter();
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId());

/** @var StatisticalDataEntity $statisticalData */
/**
* @var StatisticalDataEntity $statisticalData
*/
$statisticalData = $this->repository->selectOne($queryFilter);

return $statisticalData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ public function getItemByExecutionId(int $executionId): ?TransactionLog
->where('executionId', Operators::EQUALS, $executionId)
->orderBy('id', QueryFilter::ORDER_DESC);

/** @var TransactionLog|null $transactionLog */
/**
* @var TransactionLog|null $transactionLog
*/
$transactionLog = $this->repository->selectOne($queryFilter);

return $transactionLog;
}

/**
* @param DateTime|null $disconnectTime
* @param DateTime|null $disconnectTime
* @return int
*
* @throws QueryFilterInvalidParamException
Expand All @@ -142,7 +144,9 @@ public function findByMerchantReference(string $merchantReference): ?Transaction
$queryFilter = new QueryFilter();
$queryFilter->where('merchantReference', Operators::EQUALS, $merchantReference);

/** @var TransactionLog|null $transactionLog */
/**
* @var TransactionLog|null $transactionLog
*/
$transactionLog = $this->repository->selectOne($queryFilter);

return $transactionLog;
Expand Down Expand Up @@ -204,7 +208,9 @@ protected function getTransactionLogEntity(string $merchantReference): ?Transact
$queryFilter->where('storeId', Operators::EQUALS, $this->storeContext->getStoreId())
->where('merchantReference', Operators::EQUALS, $merchantReference);

/** @var TransactionLog|null $transactionLog */
/**
* @var TransactionLog|null $transactionLog
*/
$transactionLog = $this->repository->selectOne($queryFilter);

return $transactionLog;
Expand Down
Loading

0 comments on commit 62908c7

Please sign in to comment.