From bda40866387af40f10c5840afe850cd9611e236b Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 21 Oct 2021 00:35:28 +0200 Subject: [PATCH] TE-10081 Prepare CS for PHP73+ call commas --- .../KeyGenerator/ProductListKeyGenerator.php | 2 +- .../ProductList/ProductListReader.php | 28 +++++++++---------- .../ProductList/ProductListWriter.php | 8 +++--- .../Business/ProductListBusinessFactory.php | 16 +++++------ .../ProductListCategoryRelationPostSaver.php | 2 +- .../ProductListCategoryRelationWriter.php | 2 +- ...ctListProductConcreteRelationPostSaver.php | 2 +- ...oductListProductConcreteRelationWriter.php | 2 +- .../ProductListRestrictionValidator.php | 6 ++-- .../Persistence/ProductListRepository.php | 10 +++---- .../ProductListRestrictionFilterTest.php | 2 +- .../Persistence/ProductListRepositoryTest.php | 16 +++++------ 12 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/Spryker/Zed/ProductList/Business/KeyGenerator/ProductListKeyGenerator.php b/src/Spryker/Zed/ProductList/Business/KeyGenerator/ProductListKeyGenerator.php index a110451..a4f0234 100644 --- a/src/Spryker/Zed/ProductList/Business/KeyGenerator/ProductListKeyGenerator.php +++ b/src/Spryker/Zed/ProductList/Business/KeyGenerator/ProductListKeyGenerator.php @@ -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)); diff --git a/src/Spryker/Zed/ProductList/Business/ProductList/ProductListReader.php b/src/Spryker/Zed/ProductList/Business/ProductList/ProductListReader.php index 8d99d93..17b6f16 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductList/ProductListReader.php +++ b/src/Spryker/Zed/ProductList/Business/ProductList/ProductListReader.php @@ -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); @@ -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, + ), + ), ); } @@ -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, + ), + ), ); } @@ -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), + ), ); } @@ -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), + ), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductList/ProductListWriter.php b/src/Spryker/Zed/ProductList/Business/ProductList/ProductListWriter.php index c379e02..4f92e16 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductList/ProductListWriter.php +++ b/src/Spryker/Zed/ProductList/Business/ProductList/ProductListWriter.php @@ -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; @@ -287,7 +287,7 @@ protected function mergeProductListResponseMessages( ): ProductListResponseTransfer { $messageTransfers = array_merge( $productListResponseTransfer->getMessages()->getArrayCopy(), - $resultProductListResponseTransfer->getMessages()->getArrayCopy() + $resultProductListResponseTransfer->getMessages()->getArrayCopy(), ); return $productListResponseTransfer @@ -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(), ); } } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php b/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php index 332276f..023d97f 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListBusinessFactory.php @@ -50,7 +50,7 @@ public function createRestrictedItemsFilter(): RestrictedItemsFilterInterface { return new RestrictedItemsFilter( $this->getMessengerFacade(), - $this->createProductListRestrictionFilter() + $this->createProductListRestrictionFilter(), ); } @@ -60,7 +60,7 @@ public function createRestrictedItemsFilter(): RestrictedItemsFilterInterface public function createProductListRestrictionValidator(): ProductListRestrictionValidatorInterface { return new ProductListRestrictionValidator( - $this->createProductListRestrictionFilter() + $this->createProductListRestrictionFilter(), ); } @@ -70,7 +70,7 @@ public function createProductListRestrictionValidator(): ProductListRestrictionV public function createProductListRestrictionFilter(): ProductListRestrictionFilterInterface { return new ProductListRestrictionFilter( - $this->createProductListReader() + $this->createProductListReader(), ); } @@ -83,7 +83,7 @@ public function createProductListReader(): ProductListReaderInterface $this->getRepository(), $this->createProductListCategoryRelationReader(), $this->createProductListProductConcreteRelationReader(), - $this->getProductFacade() + $this->getProductFacade(), ); } @@ -98,7 +98,7 @@ public function createProductListWriter(): ProductListWriterInterface $this->getProductListPostSaverCollection(), $this->getProductListPreCreatePlugins(), $this->getProductListPreUpdatePlugins(), - $this->getProductListDeletePreCheckPlugins() + $this->getProductListDeletePreCheckPlugins(), ); } @@ -141,7 +141,7 @@ public function createProductListCategoryRelationWriter(): ProductListCategoryRe { return new ProductListCategoryRelationWriter( $this->getEntityManager(), - $this->createProductListCategoryRelationReader() + $this->createProductListCategoryRelationReader(), ); } @@ -152,7 +152,7 @@ public function createProductListProductConcreteRelationWriter(): ProductListPro { return new ProductListProductConcreteRelationWriter( $this->getEntityManager(), - $this->createProductListProductConcreteRelationReader() + $this->createProductListProductConcreteRelationReader(), ); } @@ -206,7 +206,7 @@ public function createProductListKeyGenerator(): ProductListKeyGeneratorInterfac { return new ProductListKeyGenerator( $this->getRepository(), - $this->getUtilTextService() + $this->getUtilTextService(), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationPostSaver.php b/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationPostSaver.php index 29481ff..702d160 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationPostSaver.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationPostSaver.php @@ -39,7 +39,7 @@ public function postSave(ProductListTransfer $productListTransfer): ProductListT if ($productListCategoryRelationTransfer) { $productListTransfer = $this->saveProductListCategoryRelation( $productListTransfer, - $productListTransfer->getProductListCategoryRelation() + $productListTransfer->getProductListCategoryRelation(), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationWriter.php b/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationWriter.php index bda70c3..f1beb44 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationWriter.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListCategoryRelation/ProductListCategoryRelationWriter.php @@ -71,7 +71,7 @@ protected function executeSaveProductListCategoryRelationTransaction( $this->productListEntityManager->removeCategoryRelations($idProductList, $deleteCategoryIds); return $productListCategoryRelationTransfer->setCategoryIds( - $this->getRelatedCategoryIds($productListCategoryRelationTransfer) + $this->getRelatedCategoryIds($productListCategoryRelationTransfer), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationPostSaver.php b/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationPostSaver.php index d3347fe..6afea82 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationPostSaver.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationPostSaver.php @@ -38,7 +38,7 @@ public function postSave(ProductListTransfer $productListTransfer): ProductListT if ($productListProductConcreteRelationTransfer) { $productListTransfer = $this->saveProductListProductConcreteRelation( $productListTransfer, - $productListTransfer->getProductListProductConcreteRelation() + $productListTransfer->getProductListProductConcreteRelation(), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationWriter.php b/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationWriter.php index e2f0a1e..431c353 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationWriter.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListProductConcreteRelation/ProductListProductConcreteRelationWriter.php @@ -71,7 +71,7 @@ protected function executeSaveProductListProductConcreteRelationTransaction( $this->productListEntityManager->removeProductConcreteRelations($idProductList, $deleteProductConcreteIds); return $productListProductConcreteRelationTransfer->setProductIds( - $this->getRelatedProductConcreteIds($productListProductConcreteRelationTransfer) + $this->getRelatedProductConcreteIds($productListProductConcreteRelationTransfer), ); } diff --git a/src/Spryker/Zed/ProductList/Business/ProductListRestrictionValidator/ProductListRestrictionValidator.php b/src/Spryker/Zed/ProductList/Business/ProductListRestrictionValidator/ProductListRestrictionValidator.php index 466e171..41debd5 100644 --- a/src/Spryker/Zed/ProductList/Business/ProductListRestrictionValidator/ProductListRestrictionValidator.php +++ b/src/Spryker/Zed/ProductList/Business/ProductListRestrictionValidator/ProductListRestrictionValidator.php @@ -67,7 +67,7 @@ public function validateItemAddition(CartChangeTransfer $cartChangeTransfer): Ca ->filterRestrictedProductConcreteSkus( $cartChangeSkus, $customerBlacklistIds, - $customerWhitelistIds + $customerWhitelistIds, ); if (empty($restrictedProductConcreteSkus)) { @@ -78,7 +78,7 @@ public function validateItemAddition(CartChangeTransfer $cartChangeTransfer): Ca $this->validateItem( $itemTransfer, $cartPreCheckResponseTransfer, - $restrictedProductConcreteSkus + $restrictedProductConcreteSkus, ); } @@ -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]), ); } } diff --git a/src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php b/src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php index 4ffac9b..72bee84 100644 --- a/src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php +++ b/src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php @@ -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); @@ -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); @@ -159,7 +159,7 @@ public function getProductConcreteSkusInBlacklists(array $productConcreteSkus, a return $this->getConcreteProductSkusInList( $productConcreteSkus, SpyProductListTableMap::COL_TYPE_BLACKLIST, - $blackListIds + $blackListIds, ); } @@ -174,7 +174,7 @@ public function getProductConcreteSkusInWhitelists(array $productConcreteSkus, a return $this->getConcreteProductSkusInList( $productConcreteSkus, SpyProductListTableMap::COL_TYPE_WHITELIST, - $whiteListIds + $whiteListIds, ); } @@ -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() diff --git a/tests/SprykerTest/Zed/ProductList/Business/ProductListRestrictionFilter/ProductListRestrictionFilterTest.php b/tests/SprykerTest/Zed/ProductList/Business/ProductListRestrictionFilter/ProductListRestrictionFilterTest.php index 82863c1..6b720b8 100644 --- a/tests/SprykerTest/Zed/ProductList/Business/ProductListRestrictionFilter/ProductListRestrictionFilterTest.php +++ b/tests/SprykerTest/Zed/ProductList/Business/ProductListRestrictionFilter/ProductListRestrictionFilterTest.php @@ -179,7 +179,7 @@ public function testFilterRestrictedProductConcreteSkusWithEmptyWhitelist(): voi protected function createProductListRestrictionFilter(): ProductListRestrictionFilterInterface { return new ProductListRestrictionFilter( - $this->productListReaderMock + $this->productListReaderMock, ); } diff --git a/tests/SprykerTest/Zed/ProductList/Persistence/ProductListRepositoryTest.php b/tests/SprykerTest/Zed/ProductList/Persistence/ProductListRepositoryTest.php index 47b4ea3..74292f4 100644 --- a/tests/SprykerTest/Zed/ProductList/Persistence/ProductListRepositoryTest.php +++ b/tests/SprykerTest/Zed/ProductList/Persistence/ProductListRepositoryTest.php @@ -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); @@ -109,7 +109,7 @@ public function testGetProductConcreteProductListIdsForTypeReturnsCorrectProduct //Act $result = $this->productListRepository->getProductConcreteProductListIdsForType( $this->productConcreteTransfer1->getIdProductConcrete(), - $productListTransfer->getType() + $productListTransfer->getType(), ); //Arrange @@ -130,7 +130,7 @@ public function testGetProductBlacklistIdsByIdProductAbstractReturnsCorrectProdu //Act $result = $this->productListRepository->getProductBlacklistIdsByIdProductAbstract( - $this->productConcreteTransfer1->getFkProductAbstract() + $this->productConcreteTransfer1->getFkProductAbstract(), ); //Arrange @@ -151,7 +151,7 @@ public function testGetAbstractProductWhitelistIdsReturnsCorrectProductListId(): //Act $result = $this->productListRepository->getAbstractProductWhitelistIds( - $this->productConcreteTransfer1->getFkProductAbstract() + $this->productConcreteTransfer1->getFkProductAbstract(), ); //Arrange @@ -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); @@ -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); @@ -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);