Skip to content

Commit

Permalink
FRW-7400 Upgraded PHPStan to 1.10.*. (#10911)
Browse files Browse the repository at this point in the history
FRW-7400 Update PHPStan to 1.10.*
  • Loading branch information
olhalivitchuk authored May 6, 2024
1 parent 0c84519 commit bddeb5d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ protected function buildGroupKey(ItemTransfer $itemTransfer): string
}

/**
* @param array<string, mixed> $options
* @param array<int, mixed> $options
*
* @return array<string, mixed>
* @return array<int, mixed>
*/
protected function sortOptions(array $options)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function expandProductConcreteTransfersWithBundledProducts(array $product
/**
* @param int $idProductConcrete
*
* @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle>
* @return \Propel\Runtime\Collection\Collection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle>
*/
protected function findBundledProducts($idProductConcrete)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Generated\Shared\Transfer\ProductConcreteTransfer;
use Generated\Shared\Transfer\StockProductTransfer;
use Orm\Zed\Stock\Persistence\SpyStockProduct;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Collection\Collection;
use Spryker\DecimalObject\Decimal;
use Spryker\Zed\ProductBundle\Business\ProductBundle\Availability\ProductBundleAvailabilityHandlerInterface;
use Spryker\Zed\ProductBundle\Dependency\Facade\ProductBundleToStoreFacadeInterface;
Expand Down Expand Up @@ -143,11 +143,11 @@ protected function updateBundleStock(
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $bundleItems
* @param \Propel\Runtime\Collection\Collection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $bundleItems
*
* @return array<int, array<string, mixed>>
*/
protected function calculateBundleStockPerWarehouse(ObjectCollection $bundleItems)
protected function calculateBundleStockPerWarehouse(Collection $bundleItems)
{
$bundledItemStock = [];
$bundledItemQuantity = [];
Expand Down Expand Up @@ -261,7 +261,7 @@ protected function findProductBundleBySku($sku)
/**
* @param int $idProductConcrete
*
* @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle>
* @return \Propel\Runtime\Collection\Collection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle>
*/
protected function findBundledItemsByIdBundleProduct($idProductConcrete)
{
Expand Down Expand Up @@ -305,7 +305,7 @@ protected function mapStockTransfer(
/**
* @param int $idProduct
*
* @return \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Stock\Persistence\SpyStockProduct>
* @return \Propel\Runtime\Collection\Collection<\Orm\Zed\Stock\Persistence\SpyStockProduct>
*/
protected function findProductStocks($idProduct)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public function getBundleItemsBySalesOrderItemIds(array $salesOrderItemIds): arr
*/
public function getProductConcretesRawDataByProductConcreteSkus(array $productConcreteSkus): array
{
return $this->getFactory()
/** @var \Propel\Runtime\Collection\ArrayCollection $productConcretesRawDataByProductConcreteSkus */
$productConcretesRawDataByProductConcreteSkus = $this->getFactory()
->createProductBundleQuery()
->useSpyProductRelatedByFkProductQuery()
->filterBySku_In($productConcreteSkus)
Expand All @@ -186,8 +187,9 @@ public function getProductConcretesRawDataByProductConcreteSkus(array $productCo
ItemTransfer::ID_PRODUCT_ABSTRACT,
ItemTransfer::SKU,
])
->find()
->toArray(ItemTransfer::SKU);
->find();

return $productConcretesRawDataByProductConcreteSkus->toArray(ItemTransfer::SKU);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Generated\Shared\Transfer\ProductForBundleTransfer;
use Orm\Zed\ProductBundle\Persistence\SpySalesOrderItemBundle;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;

class ProductBundleMapper
{
Expand Down Expand Up @@ -61,7 +60,7 @@ public function mapProductBundleEntitiesToProductBundleCollectionTransfer(
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $productBundleEntities
* @param \Propel\Runtime\Collection\Collection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $productBundleEntities
* @param \Generated\Shared\Transfer\ProductBundleCollectionTransfer $productBundleCollectionTransfer
*
* @return \Generated\Shared\Transfer\ProductBundleCollectionTransfer
Expand All @@ -84,11 +83,11 @@ public function mapProductBundleEntityCollectionToProductBundleCollectionTransfe
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection $salesOrderItemBundleEntities
* @param \Propel\Runtime\Collection\Collection $salesOrderItemBundleEntities
*
* @return array<\Generated\Shared\Transfer\ItemTransfer>
*/
public function mapSalesOrderItemBundleEntitiesToItemTransfers(ObjectCollection $salesOrderItemBundleEntities): array
public function mapSalesOrderItemBundleEntitiesToItemTransfers(Collection $salesOrderItemBundleEntities): array
{
$bundleItemTransfers = [];

Expand Down Expand Up @@ -141,7 +140,7 @@ protected function mapSalesOrderItemBundleEntityToItemTransfer(SpySalesOrderItem
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $productBundleEntities
* @param \Propel\Runtime\Collection\Collection<\Orm\Zed\ProductBundle\Persistence\SpyProductBundle> $productBundleEntities
*
* @return array<array<\Generated\Shared\Transfer\ProductForBundleTransfer>>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public function testExpandBundleItemsShouldSkipCopyFromBundleItemToBundledItems(
* @param \Spryker\Zed\ProductBundle\Dependency\Facade\ProductBundleToPriceProductFacadeInterface|null $priceProductFacadeMock
* @param \Spryker\Zed\ProductBundle\Dependency\Facade\ProductBundleToProductFacadeInterface|null $productFacadeMock
* @param \Spryker\Zed\ProductBundle\Dependency\Facade\ProductBundleToLocaleFacadeInterface|null $localeFacadeMock
* @param \Spryker\Zed\ProductBundle\ProductBundleConfig|null $productBundleConfigMock
*
* @return \PHPUnit\Framework\MockObject\MockObject|\Spryker\Zed\ProductBundle\Business\ProductBundle\Cart\ProductBundleCartExpander
*/
Expand Down

0 comments on commit bddeb5d

Please sign in to comment.