Skip to content

Commit

Permalink
TE-10081 Prepare CS for PHP73+ call commas
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 20, 2021
1 parent d3f522a commit bda4086
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function generateProductListKey(string $name): string
$candidate = sprintf(
static::PRODUCT_LIST_KEY_PATTERN,
$this->utilTextService->generateSlug($name),
++$index
++$index,
);
} while ($this->productListRepository->hasKey($candidate));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public function getProductListsByProductIds(array $productConcreteIds): array
$productConcreteIdsToProductAbstractIdsMap = $this->productFacade->getProductAbstractIdsByProductConcreteIds($productConcreteIds);

$productConcreteLists = $this->mapProductListIdsByIdProductConcreteAndType(
$this->productListRepository->getProductListIdsByProductIds($productConcreteIds)
$this->productListRepository->getProductListIdsByProductIds($productConcreteIds),
);

$productAbstractLists = $this->getProductAbstractListIdsByProductAbstractIds(
array_values($productConcreteIdsToProductAbstractIdsMap)
array_values($productConcreteIdsToProductAbstractIdsMap),
);

return $this->mergeProductConcreteAndProductAbstractLists($productConcreteLists, $productAbstractLists, $productConcreteIdsToProductAbstractIdsMap);
Expand Down Expand Up @@ -135,13 +135,13 @@ public function getProductBlacklistIdsByIdProduct(int $idProduct): array
array_merge(
$this->productListRepository->getProductConcreteProductListIdsForType(
$idProduct,
SpyProductListTableMap::COL_TYPE_BLACKLIST
SpyProductListTableMap::COL_TYPE_BLACKLIST,
),
$this->productListRepository->getProductConcreteProductListIdsRelatedToCategoriesForType(
$idProduct,
SpyProductListTableMap::COL_TYPE_BLACKLIST
)
)
SpyProductListTableMap::COL_TYPE_BLACKLIST,
),
),
);
}

Expand All @@ -156,13 +156,13 @@ public function getProductWhitelistIdsByIdProduct(int $idProduct): array
array_merge(
$this->productListRepository->getProductConcreteProductListIdsForType(
$idProduct,
SpyProductListTableMap::COL_TYPE_WHITELIST
SpyProductListTableMap::COL_TYPE_WHITELIST,
),
$this->productListRepository->getProductConcreteProductListIdsRelatedToCategoriesForType(
$idProduct,
SpyProductListTableMap::COL_TYPE_WHITELIST
)
)
SpyProductListTableMap::COL_TYPE_WHITELIST,
),
),
);
}

Expand Down Expand Up @@ -229,8 +229,8 @@ public function getProductAbstractIdsByProductListIds(array $productListIds): ar
return array_unique(
array_merge(
$this->productListRepository->getProductAbstractIdsRelatedToProductConcrete($productListIds),
$this->productListRepository->getProductAbstractIdsRelatedToCategories($productListIds)
)
$this->productListRepository->getProductAbstractIdsRelatedToCategories($productListIds),
),
);
}

Expand All @@ -244,8 +244,8 @@ public function getProductConcreteIdsByProductListIds(array $productListIds): ar
return array_unique(
array_merge(
$this->productListRepository->getProductConcreteIdsRelatedToProductLists($productListIds),
$this->productListRepository->getProductConcreteIdsRelatedToProductListsCategories($productListIds)
)
$this->productListRepository->getProductConcreteIdsRelatedToProductListsCategories($productListIds),
),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected function executeDeleteProductListTransaction(
$this->productListEntityManager->deleteProductList($productListTransfer);

$productListResponseTransfer->addMessage(
(new MessageTransfer())->setValue(static::MESSAGE_PRODUCT_LIST_DELETE_SUCCESS)
(new MessageTransfer())->setValue(static::MESSAGE_PRODUCT_LIST_DELETE_SUCCESS),
);

return $productListResponseTransfer;
Expand Down Expand Up @@ -287,7 +287,7 @@ protected function mergeProductListResponseMessages(
): ProductListResponseTransfer {
$messageTransfers = array_merge(
$productListResponseTransfer->getMessages()->getArrayCopy(),
$resultProductListResponseTransfer->getMessages()->getArrayCopy()
$resultProductListResponseTransfer->getMessages()->getArrayCopy(),
);

return $productListResponseTransfer
Expand All @@ -306,11 +306,11 @@ protected function mergeProductListResponseTransfers(
): ProductListResponseTransfer {
$productListResponseTransfer = $this->mergeProductListResponseMessages(
$productListResponseTransfer,
$resultProductListResponseTransfer
$resultProductListResponseTransfer,
);

return $productListResponseTransfer->setIsSuccessful(
$productListResponseTransfer->getIsSuccessful() && $resultProductListResponseTransfer->getIsSuccessful()
$productListResponseTransfer->getIsSuccessful() && $resultProductListResponseTransfer->getIsSuccessful(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function createRestrictedItemsFilter(): RestrictedItemsFilterInterface
{
return new RestrictedItemsFilter(
$this->getMessengerFacade(),
$this->createProductListRestrictionFilter()
$this->createProductListRestrictionFilter(),
);
}

Expand All @@ -60,7 +60,7 @@ public function createRestrictedItemsFilter(): RestrictedItemsFilterInterface
public function createProductListRestrictionValidator(): ProductListRestrictionValidatorInterface
{
return new ProductListRestrictionValidator(
$this->createProductListRestrictionFilter()
$this->createProductListRestrictionFilter(),
);
}

Expand All @@ -70,7 +70,7 @@ public function createProductListRestrictionValidator(): ProductListRestrictionV
public function createProductListRestrictionFilter(): ProductListRestrictionFilterInterface
{
return new ProductListRestrictionFilter(
$this->createProductListReader()
$this->createProductListReader(),
);
}

Expand All @@ -83,7 +83,7 @@ public function createProductListReader(): ProductListReaderInterface
$this->getRepository(),
$this->createProductListCategoryRelationReader(),
$this->createProductListProductConcreteRelationReader(),
$this->getProductFacade()
$this->getProductFacade(),
);
}

Expand All @@ -98,7 +98,7 @@ public function createProductListWriter(): ProductListWriterInterface
$this->getProductListPostSaverCollection(),
$this->getProductListPreCreatePlugins(),
$this->getProductListPreUpdatePlugins(),
$this->getProductListDeletePreCheckPlugins()
$this->getProductListDeletePreCheckPlugins(),
);
}

Expand Down Expand Up @@ -141,7 +141,7 @@ public function createProductListCategoryRelationWriter(): ProductListCategoryRe
{
return new ProductListCategoryRelationWriter(
$this->getEntityManager(),
$this->createProductListCategoryRelationReader()
$this->createProductListCategoryRelationReader(),
);
}

Expand All @@ -152,7 +152,7 @@ public function createProductListProductConcreteRelationWriter(): ProductListPro
{
return new ProductListProductConcreteRelationWriter(
$this->getEntityManager(),
$this->createProductListProductConcreteRelationReader()
$this->createProductListProductConcreteRelationReader(),
);
}

Expand Down Expand Up @@ -206,7 +206,7 @@ public function createProductListKeyGenerator(): ProductListKeyGeneratorInterfac
{
return new ProductListKeyGenerator(
$this->getRepository(),
$this->getUtilTextService()
$this->getUtilTextService(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function postSave(ProductListTransfer $productListTransfer): ProductListT
if ($productListCategoryRelationTransfer) {
$productListTransfer = $this->saveProductListCategoryRelation(
$productListTransfer,
$productListTransfer->getProductListCategoryRelation()
$productListTransfer->getProductListCategoryRelation(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function executeSaveProductListCategoryRelationTransaction(
$this->productListEntityManager->removeCategoryRelations($idProductList, $deleteCategoryIds);

return $productListCategoryRelationTransfer->setCategoryIds(
$this->getRelatedCategoryIds($productListCategoryRelationTransfer)
$this->getRelatedCategoryIds($productListCategoryRelationTransfer),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function postSave(ProductListTransfer $productListTransfer): ProductListT
if ($productListProductConcreteRelationTransfer) {
$productListTransfer = $this->saveProductListProductConcreteRelation(
$productListTransfer,
$productListTransfer->getProductListProductConcreteRelation()
$productListTransfer->getProductListProductConcreteRelation(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function executeSaveProductListProductConcreteRelationTransaction(
$this->productListEntityManager->removeProductConcreteRelations($idProductList, $deleteProductConcreteIds);

return $productListProductConcreteRelationTransfer->setProductIds(
$this->getRelatedProductConcreteIds($productListProductConcreteRelationTransfer)
$this->getRelatedProductConcreteIds($productListProductConcreteRelationTransfer),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function validateItemAddition(CartChangeTransfer $cartChangeTransfer): Ca
->filterRestrictedProductConcreteSkus(
$cartChangeSkus,
$customerBlacklistIds,
$customerWhitelistIds
$customerWhitelistIds,
);

if (empty($restrictedProductConcreteSkus)) {
Expand All @@ -78,7 +78,7 @@ public function validateItemAddition(CartChangeTransfer $cartChangeTransfer): Ca
$this->validateItem(
$itemTransfer,
$cartPreCheckResponseTransfer,
$restrictedProductConcreteSkus
$restrictedProductConcreteSkus,
);
}

Expand Down Expand Up @@ -116,7 +116,7 @@ protected function addViolation(string $sku, CartPreCheckResponseTransfer $cartP
$cartPreCheckResponseTransfer->addMessage(
(new MessageTransfer())
->setValue(static::MESSAGE_INFO_RESTRICTED_PRODUCT_REMOVED)
->setParameters([static::MESSAGE_PARAM_SKU => $sku])
->setParameters([static::MESSAGE_PARAM_SKU => $sku]),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getProductBlacklistIdsByIdProductAbstract(int $idProductAbstract
$blacklistIds = array_merge(
$blacklistIds,
$this->getProductBlacklistIdsByIdAbstractProduct($idProductAbstract),
$this->getCategoryBlacklistIdsByIdAbstractProduct($idProductAbstract)
$this->getCategoryBlacklistIdsByIdAbstractProduct($idProductAbstract),
);

return array_unique($blacklistIds);
Expand All @@ -106,7 +106,7 @@ public function getAbstractProductWhitelistIds(int $idProductAbstract): array
$whitelistIds = array_merge(
$whitelistIds,
$this->getProductWhitelistIdsByIdAbstractProduct($idProductAbstract),
$this->getCategoryWhitelistIdsByIdAbstractProduct($idProductAbstract)
$this->getCategoryWhitelistIdsByIdAbstractProduct($idProductAbstract),
);

return array_unique($whitelistIds);
Expand Down Expand Up @@ -159,7 +159,7 @@ public function getProductConcreteSkusInBlacklists(array $productConcreteSkus, a
return $this->getConcreteProductSkusInList(
$productConcreteSkus,
SpyProductListTableMap::COL_TYPE_BLACKLIST,
$blackListIds
$blackListIds,
);
}

Expand All @@ -174,7 +174,7 @@ public function getProductConcreteSkusInWhitelists(array $productConcreteSkus, a
return $this->getConcreteProductSkusInList(
$productConcreteSkus,
SpyProductListTableMap::COL_TYPE_WHITELIST,
$whiteListIds
$whiteListIds,
);
}

Expand Down Expand Up @@ -494,7 +494,7 @@ public function getProductBlacklistsByProductAbstractIds(array $productAbstractI
->having(sprintf(
'COUNT(DISTINCT %s) = COUNT(DISTINCT %s)',
SpyProductListProductConcreteTableMap::COL_FK_PRODUCT,
SpyProductTableMap::alias($spyProductTableAlias, SpyProductTableMap::COL_ID_PRODUCT)
SpyProductTableMap::alias($spyProductTableAlias, SpyProductTableMap::COL_ID_PRODUCT),
))
->setFormatter(SimpleArrayFormatter::class)
->find()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function testFilterRestrictedProductConcreteSkusWithEmptyWhitelist(): voi
protected function createProductListRestrictionFilter(): ProductListRestrictionFilterInterface
{
return new ProductListRestrictionFilter(
$this->productListReaderMock
$this->productListReaderMock,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testGetProductListIdsByProductIdsReturnsCorrectData(): void
$this->assertCount(2, $result);
$resultProductConcreteIds = array_map(
'intval',
array_column($result, SpyProductListProductConcreteTableMap::COL_FK_PRODUCT)
array_column($result, SpyProductListProductConcreteTableMap::COL_FK_PRODUCT),
);
$this->assertContains($productConcreteIds[0], $resultProductConcreteIds);
$this->assertContains($productConcreteIds[1], $resultProductConcreteIds);
Expand All @@ -109,7 +109,7 @@ public function testGetProductConcreteProductListIdsForTypeReturnsCorrectProduct
//Act
$result = $this->productListRepository->getProductConcreteProductListIdsForType(
$this->productConcreteTransfer1->getIdProductConcrete(),
$productListTransfer->getType()
$productListTransfer->getType(),
);

//Arrange
Expand All @@ -130,7 +130,7 @@ public function testGetProductBlacklistIdsByIdProductAbstractReturnsCorrectProdu

//Act
$result = $this->productListRepository->getProductBlacklistIdsByIdProductAbstract(
$this->productConcreteTransfer1->getFkProductAbstract()
$this->productConcreteTransfer1->getFkProductAbstract(),
);

//Arrange
Expand All @@ -151,7 +151,7 @@ public function testGetAbstractProductWhitelistIdsReturnsCorrectProductListId():

//Act
$result = $this->productListRepository->getAbstractProductWhitelistIds(
$this->productConcreteTransfer1->getFkProductAbstract()
$this->productConcreteTransfer1->getFkProductAbstract(),
);

//Arrange
Expand Down Expand Up @@ -182,14 +182,14 @@ public function testGetProductListByProductAbstractIdsThroughCategoryReturnsCorr

//Act
$result = $this->productListRepository->getProductListByProductAbstractIdsThroughCategory(
$productAbstractIds
$productAbstractIds,
);

//Arrange
$this->assertCount(2, $result);
$resultProductAbstractIds = array_map(
'intval',
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT)
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT),
);
$this->assertContains($productAbstractIds[0], $resultProductAbstractIds);
$this->assertContains($productAbstractIds[1], $resultProductAbstractIds);
Expand Down Expand Up @@ -218,7 +218,7 @@ public function testGetProductBlacklistsByProductAbstractIdsReturnsCorrectData()
$this->assertCount(2, $result);
$resultProductAbstractIds = array_map(
'intval',
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT)
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT),
);
$this->assertContains($productAbstractIds[0], $resultProductAbstractIds);
$this->assertContains($productAbstractIds[1], $resultProductAbstractIds);
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testGetProductWhitelistsByProductAbstractIdsReturnsCorrectData()
$this->assertCount(2, $result);
$resultProductAbstractIds = array_map(
'intval',
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT)
array_column($result, ProductListRepository::COL_ID_PRODUCT_ABSTRACT),
);
$this->assertContains($productAbstractIds[0], $resultProductAbstractIds);
$this->assertContains($productAbstractIds[1], $resultProductAbstractIds);
Expand Down

0 comments on commit bda4086

Please sign in to comment.