Skip to content

Commit

Permalink
added sniffs requiring trailing commas in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik committed Jun 15, 2023
1 parent fb1234e commit abc5ff8
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 79 deletions.
6 changes: 3 additions & 3 deletions src/Brand/BrandViewFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BrandViewFacade implements BrandViewFacadeInterface
public function __construct(
protected readonly ProductFacade $productFacade,
protected readonly BrandViewFactory $brandViewFactory,
protected readonly FriendlyUrlFacade $friendlyUrlFacade
protected readonly FriendlyUrlFacade $friendlyUrlFacade,
) {
}

Expand All @@ -39,8 +39,8 @@ public function findByProductId(int $productId): ?BrandView
$brand,
$this->friendlyUrlFacade->getAbsoluteUrlByRouteNameAndEntityIdOnCurrentDomain(
'front_brand_detail',
$brand->getId()
)
$brand->getId(),
),
);
}
}
2 changes: 1 addition & 1 deletion src/Brand/BrandViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function createFromBrand(Brand $brand, string $brandMainUrl): BrandView
return new BrandView(
$brand->getId(),
$brand->getName(),
$brandMainUrl
$brandMainUrl,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Parameter/ParameterView.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
protected readonly int $id,
protected readonly string $name,
protected readonly int $valueId,
protected readonly string $valueText
protected readonly string $valueText,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Parameter/ParameterViewFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ParameterViewFacade implements ParameterViewFacadeInterface
public function __construct(
protected readonly ProductFacade $productFacade,
protected readonly ParameterViewFactory $parameterViewFactory,
protected readonly ProductCachedAttributesFacade $productCachedAttributesFacade
protected readonly ProductCachedAttributesFacade $productCachedAttributesFacade,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Parameter/ParameterViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function createFromProductParameterValue(ProductParameterValue $productPa
$productParameterValue->getParameter()->getId(),
$productParameterValue->getParameter()->getName(),
$productParameterValue->getValue()->getId(),
$productParameterValue->getValue()->getText()
$productParameterValue->getValue()->getText(),
);
}

Expand All @@ -32,7 +32,7 @@ public function createFromParameterArray(array $parameterArray): ParameterView
$parameterArray['parameter_id'],
$parameterArray['parameter_name'],
$parameterArray['parameter_value_id'],
$parameterArray['parameter_value_text']
$parameterArray['parameter_value_text'],
);
}
}
4 changes: 2 additions & 2 deletions src/Product/Action/ProductActionViewFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getForProducts(array $products): array
{
$absoluteUrlsIndexedByProductId = $this->productCollectionFacade->getAbsoluteUrlsIndexedByProductId(
$products,
$this->domain->getCurrentDomainConfig()
$this->domain->getCurrentDomainConfig(),
);

$productActionViews = [];
Expand All @@ -37,7 +37,7 @@ public function getForProducts(array $products): array

$productActionViews[$productId] = $this->productActionViewFactory->createFromProduct(
$product,
$absoluteUrlsIndexedByProductId[$productId]
$absoluteUrlsIndexedByProductId[$productId],
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Product/Action/ProductActionViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function create(int $id, bool $sellingDenied, bool $isMainVariant, str
$id,
$sellingDenied,
$isMainVariant,
$detailUrl
$detailUrl,
);
}

Expand All @@ -36,7 +36,7 @@ public function createFromProduct(Product $product, string $absoluteUrl): Produc
$product->getId(),
$product->getCalculatedSellingDenied(),
$product->isMainVariant(),
$absoluteUrl
$absoluteUrl,
);
}

Expand All @@ -50,7 +50,7 @@ public function createFromArray(array $productArray): ProductActionView
$productArray['id'],
$productArray['calculated_selling_denied'],
$productArray['is_main_variant'],
$productArray['detail_url']
$productArray['detail_url'],
);
}
}
4 changes: 2 additions & 2 deletions src/Product/Detail/ProductDetailViewElasticsearchFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ProductDetailViewElasticsearchFacade implements ProductDetailViewFacadeInt
*/
public function __construct(
protected readonly ProductDetailViewElasticsearchFactory $productDetailViewElasticsearchFactory,
protected readonly ProductElasticsearchProvider $productElasticsearchProvider
protected readonly ProductElasticsearchProvider $productElasticsearchProvider,
) {
}

Expand All @@ -25,7 +25,7 @@ public function __construct(
public function getVisibleProductDetail(int $productId): ProductDetailView
{
return $this->productDetailViewElasticsearchFactory->createFromProductArray(
$this->productElasticsearchProvider->getVisibleProductArrayById($productId)
$this->productElasticsearchProvider->getVisibleProductArrayById($productId),
);
}
}
10 changes: 5 additions & 5 deletions src/Product/Detail/ProductDetailViewElasticsearchFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(
protected readonly Domain $domain,
protected readonly ProductElasticsearchProvider $productElasticsearchProvider,
protected readonly ListedProductViewFactory $listedProductViewFactory,
protected readonly PriceFactory $priceFactory
protected readonly PriceFactory $priceFactory,
) {
}

Expand All @@ -65,7 +65,7 @@ public function createFromProductArray(array $productArray): ProductDetailView
$parameterViews,
$this->brandViewFactory->createFromProductArray($productArray),
$this->getListedProductViewsByProductIds($productArray['accessories']),
$this->getListedProductViewsByProductIds($productArray['variants'])
$this->getListedProductViewsByProductIds($productArray['variants']),
);
}

Expand All @@ -84,7 +84,7 @@ protected function createInstance(
array $parameterViews,
BrandView $brandView,
array $accessories,
array $variants
array $variants,
): ProductDetailView {
return new ProductDetailView(
$productArray['id'],
Expand All @@ -107,7 +107,7 @@ protected function createInstance(
$variants,
$this->priceFactory->createProductPriceFromArrayByPricingGroup(
$productArray['prices'],
$this->currentCustomerUser->getPricingGroup()
$this->currentCustomerUser->getPricingGroup(),
),
$productArray['main_category_id'],
$productArray['main_variant_id'],
Expand Down Expand Up @@ -151,7 +151,7 @@ protected function getListedProductViewsByProductIds(array $productIds): array
}

return $this->listedProductViewFactory->createFromProductsArray(
$this->productElasticsearchProvider->getSellableProductArrayByIds($productIds)
$this->productElasticsearchProvider->getSellableProductArrayByIds($productIds),
);
}
}
2 changes: 1 addition & 1 deletion src/Product/Detail/ProductDetailViewFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ProductDetailViewFacade implements ProductDetailViewFacadeInterface
*/
public function __construct(
protected readonly ProductDetailViewFactory $productDetailViewFactory,
protected readonly ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade
protected readonly ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Product/Detail/ProductDetailViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
protected readonly CategoryFacade $categoryFacade,
protected readonly SeoSettingFacade $seoSettingFacade,
protected readonly ListedProductViewFacadeInterface $listedProductViewFacade,
protected readonly ListedProductVariantsViewFacadeInterface $listedProductVariantsViewFacade
protected readonly ListedProductVariantsViewFacadeInterface $listedProductVariantsViewFacade,
) {
}

Expand All @@ -71,7 +71,7 @@ public function createFromProduct(Product $product): ProductDetailView
$productActionView,
$parameterViews,
$accessories,
$variants
$variants,
);
}

Expand All @@ -96,7 +96,7 @@ protected function createInstance(
ProductActionView $productActionView,
array $parameterViews,
array $accessories,
array $variants
array $variants,
): ProductDetailView {
$domainId = $this->domain->getId();
$locale = $this->domain->getLocale();
Expand Down
4 changes: 2 additions & 2 deletions src/Product/Listed/ListedProductVariantsViewFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ListedProductVariantsViewFacade implements ListedProductVariantsViewFacade
*/
public function __construct(
protected readonly ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade,
protected readonly ListedProductViewFactory $listedProductViewFactory
protected readonly ListedProductViewFactory $listedProductViewFactory,
) {
}

Expand All @@ -31,7 +31,7 @@ public function getAllVariants(int $productId): array
}

return $this->listedProductViewFactory->createFromProducts(
$this->productOnCurrentDomainFacade->getVariantsForProduct($product)
$this->productOnCurrentDomainFacade->getVariantsForProduct($product),
);
}
}
22 changes: 11 additions & 11 deletions src/Product/Listed/ListedProductViewElasticFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
protected readonly ListedProductViewFactory $listedProductViewFactory,
protected readonly ImageViewFacadeInterface $imageViewFacade,
protected readonly ProductActionViewFactory $productActionViewFactory,
protected readonly ProductElasticsearchProvider $productElasticsearchProvider
protected readonly ProductElasticsearchProvider $productElasticsearchProvider,
) {
}

Expand All @@ -54,7 +54,7 @@ public function getTop(int $limit): array
{
$topProducts = $this->topProductFacade->getAllOfferedProducts(
$this->domain->getId(),
$this->currentCustomerUser->getPricingGroup()
$this->currentCustomerUser->getPricingGroup(),
);

$topProducts = array_slice($topProducts, 0, $limit);
Expand All @@ -69,7 +69,7 @@ public function getAllTop(): array
{
$topProducts = $this->topProductFacade->getAllOfferedProducts(
$this->domain->getId(),
$this->currentCustomerUser->getPricingGroup()
$this->currentCustomerUser->getPricingGroup(),
);

return $this->listedProductViewFactory->createFromProducts($topProducts);
Expand All @@ -89,7 +89,7 @@ public function getAccessories(int $productId, int $limit): array
}

return $this->listedProductViewFactory->createFromProductsArray(
$this->productElasticsearchProvider->getSellableProductArrayByIds($productArray['accessories'], $limit)
$this->productElasticsearchProvider->getSellableProductArrayByIds($productArray['accessories'], $limit),
);
}

Expand All @@ -106,7 +106,7 @@ public function getAllAccessories(int $productId): array
}

return $this->listedProductViewFactory->createFromProductsArray(
$this->productElasticsearchProvider->getSellableProductArrayByIds($productArray['accessories'])
$this->productElasticsearchProvider->getSellableProductArrayByIds($productArray['accessories']),
);
}

Expand All @@ -125,7 +125,7 @@ public function getFilteredPaginatedInCategory(int $categoryId, ProductFilterDat
$orderingModeId,
$page,
$limit,
$categoryId
$categoryId,
);

return $this->createPaginationResultWithArray($paginationResult);
Expand All @@ -146,7 +146,7 @@ public function getFilteredPaginatedForSearch(string $searchText, ProductFilterD
$filterData,
$orderingModeId,
$page,
$limit
$limit,
);

return $this->createPaginationResultWithArray($paginationResult);
Expand All @@ -165,7 +165,7 @@ public function getPaginatedForBrand(int $brandId, string $orderingModeId, int $
$orderingModeId,
$page,
$limit,
$brandId
$brandId,
);

return $this->createPaginationResultWithArray($paginationResult);
Expand All @@ -181,7 +181,7 @@ protected function createPaginationResultWithArray(PaginationResult $paginationR
$paginationResult->getPage(),
$paginationResult->getPageSize(),
$paginationResult->getTotalCount(),
$this->createFromArray($paginationResult->getResults())
$this->createFromArray($paginationResult->getResults()),
);
}

Expand All @@ -193,7 +193,7 @@ protected function createFromArray(array $productsArray): array
{
$imageViews = $this->imageViewFacade->getMainImagesByEntityIds(
Product::class,
array_column($productsArray, 'id')
array_column($productsArray, 'id'),
);

$listedProductViews = [];
Expand All @@ -206,7 +206,7 @@ protected function createFromArray(array $productsArray): array
$productArray,
$imageViews[$productId],
$this->productActionViewFactory->createFromArray($productArray),
$this->currentCustomerUser->getPricingGroup()
$this->currentCustomerUser->getPricingGroup(),
);
} catch (NoProductPriceForPricingGroupException $exception) {
continue;
Expand Down
Loading

0 comments on commit abc5ff8

Please sign in to comment.